President Donald Trump’s revised executive order restricting travel from terrorist safe havens is just as constitutional and legal as his original order, despite what some courts such as the 9th U.S. Circuit Court of Appeals said about the original order.

But the revisions he has made, which clarify that the executive order does not apply to any foreigners who already hold visas to enter the U.S., will make it tougher for activist judges to justify any injunction orders they might be inclined to issue against it. Yet there is little doubt that progressive groups will seek such orders.

The executive order, “Protecting the Nation from Foreign Terrorist Entry into the United States,” confirms what the administration had previously announced, which is that the temporary, 90-day suspension of entry into the U.S. from certain designated countries will not apply to:

Lawful permanent residents as well as diplomatic, NATO, and U.N. personnel.

Foreign nationals admitted after the effective date of the executive order.

Individuals with a visa valid on the date of the executive order.

Dual nationals travelling on a passport issued by a non-designated country.

Individuals already granted asylum or refugee status before the effective date of the executive order.

This is an important revision because it voids the due process concerns that the 9th Circuit expressed—namely, that individuals who had already received approval to enter or reside in the United States might have that right taken away from them without a review and appeal process.

The revised executive order reduces the number of designated countries to which the visa suspension applies by one. Iraq has been removed from the original list, while Sudan, Syria, Iran, Libya, Somalia, and Yemen remain on the list.

Apparently, the administration conducted negotiations with Iraq last month that resulted in Iraq agreeing to increase its cooperation in vetting Iraqis applying for travel into the U.S.

The six remaining countries had been designated by the Obama administration as “countries of concern” (Libya, Somalia, and Yemen) or state sponsors of terrorism (Iran, Syria, and Sudan). The new executive order lists specific reasons for each country’s inclusion in the suspension taken from the State Department’s Country Reports on Terrorism 2015 (released in June 2016).

>>> Related: Experts Differ on Whether Trump’s New Travel Ban Will Make America Safer

It is certainly common sense (and easy to understand) why one would suspend entry from countries whose governments are official sponsors of terrorism, given that we could not trust any records those governments produce when their citizens are being vetted.

And the executive order points out that the other three countries were designated as “countries of concern” by Jeh Johnson, President Barack Obama’s secretary of homeland security, in 2016 based on three statutory factors set out by Congress:

Whether the presence of an alien in the country or area increases the likelihood that the alien is a credible threat to the national security of the United States. Whether a foreign terrorist organization has a significant presence in the country or area. Whether the country or area is a safe haven for terrorists.

So under the prior administration’s own standards, this 90-day suspension until a more thorough vetting process can be implemented is only from countries that are, in essence, terrorist safe havens that the government has been concerned about for many years.

The revised executive order repeats the 120-day suspension of refugee admissions to allow the Department of Homeland Security to revise its screening procedures to ensure that refuges do not pose a security risk, although the suspension will not apply to any refuges already formally scheduled for transit by the State Department.

.@POTUS has signed a new executive order that will keep the nation safe. Read it at https://t.co/XcBwwEJJHF pic.twitter.com/Yx2mikXl2A — Sean Spicer (@PressSec) March 6, 2017

The order also makes a point of refuting claims that were raised in various lawsuits that the original order was intended to discriminate against Muslims: It “did not provide a basis for discriminating for or against members of any particular religion.”

The original order did allow for prioritization of refugee claims, once the 120-day suspension period lapses, from persecuted religious minorities—but that priority “applied to refugees from every nation, including those in which Islam is a minority religion, and it applied to minority sects within a religion.”

That prioritization is not in the revised order, although that is not really needed since federal immigration law (8 U.S.C. §1101 (a)(42)(A)) already defines refugees as including those persecuted because of their religion.

Finally, the revised executive order also takes the time to answer another question that arose in the litigation over the previously issued executive order. The order specifically states that since 2001, “hundreds of persons born abroad have been convicted of terrorism-related crimes in the United States. They have included not just persons who came here legally on visas but also individuals who first entered the country as refugees.”

That includes the two Iraqi nationals convicted in 2013 for multiple terrorism-related offenses who were admitted as refuges in 2009. According to the order, Trump has been informed by the attorney general “that more than 300 persons who entered the Untied States as refuges are currently the subjects of counterterrorism investigations” by the FBI.

This executive order is clearly within the president’s authority under 8 U.S.C. § 1182 (f), in which Congress clearly delegated to the president the authority to suspend the entry of any aliens into the U.S. when he believes it would be “detrimental to the interests of the United States.”

Whether that will deter activist judges who don’t like this policy from enjoining it is still another question.