The Trump administration is weighing its legal options after an appeals court ruling against the president’s executive action on immigration, including the possibility of rewriting the order.

President Trump on hinted Friday that he will make a new policy announcement as soon as next week in response to the court decision.

“We’ll be doing something very rapidly having to do with additional security for our country,” Trump said during a joint press conference with Japanese Prime Minister Shinzo Abe. “You’ll see something next week.”

Although Trump declared on Twitter “SEE YOU IN COURT” shortly after a three-judge panel refused to reinstate his temporary travel ban, the Department of Justice (DOJ) signaled on Friday that “all options” are on the table.

“All options are being considered across the spectrum,” a DOJ lawyer said during a federal court hearing on another case in Virginia, according to BuzzFeed. “We may appeal, we may not.”

DOJ lawyer in Virginia federal court today on 9th Circuit order: “All options are being considered across the spectrum.”

— Zoe Tillman (@ZoeTillman) February 10, 2017

DOJ lawyer said they are still reviewing the 9th Circuit’s order yesterday and haven’t decided next move. “We may appeal, we may not.”

— Zoe Tillman (@ZoeTillman) February 10, 2017

One route reportedly under consideration at the White House is scrapping the old executive order and writing a new one that can pass legal muster.

NBC on Friday reported that work on a new travel ban began several days before the San Francisco-based U.S. Court of Appeals for the Ninth Circuit refused to lift a temporary restraining order against the policy.

A federal judge in Seattle put the controversial policy on ice last week so the courts could consider a legal challenge from Washington and Minnesota. The appeals court late Thursday refused to lift that order.

Trump’s executive action, which barred people from seven majority Muslim countries from entering the U.S. for 90 days, sparked intense backlash.

Chaos and confusion erupted at airports around the country as visa holders and legal permanent residents were detained and denied entry into the U.S. Among those caught in the crosshairs was an Iraqi interpreter who worked for the U.S. Army.

The order also temporarily halted refugee resettlement in the U.S., and banned Syrian refugees indefinitely.

The ban was reportedly written without the input of key Republican lawmakers and agency officials. The administration later clarified that the policy does not apply to green card holders, while the State Department reinstated thousands of visas that were revoked.

The states challenging the ban have argued that they have legal standing for a lawsuit because their residents were directly harmed by it, citing families that were separated, public university students and scholars who were stranded abroad, and other residents who were afraid to travel.

The three-judge panel at the appeals court agreed that the states have shown sufficient legal standing at this stage to bring the suit, even though the president has broad authority over national security matters.

Using the appeals court opinion as a playbook, Trump’s lawyers could rework the language to clarify that the order doesn’t apply to legal permanent residents, students and professors, and other certain visa holders. An order tailored in that way could stand a better chance of winning in court.

But the appeals court ruling threw more than one obstacle in the administration’s path.

It also asserted that even non-residents who have never been to the U.S., like refugees, are still entitled to due process rights — such as providing notice and a hearing prior to restricting an individual’s ability to travel.

The court suggested that the protections provided by the Fifth Amendment are not limited to U.S. citizens.

“We cannot say that the current interpretation by White House counsel, even if authoritative and binding, will persist past the immediate stage of these proceedings,” the judges wrote.

The appeals court also said that the states of Washington and Minnesota, not just residents, were being harmed by Trump’s order due to diminished tax revenues.

And while the judges declined to weigh in on whether they think the policy is a form of religious discrimination, they did acknowledge that there were “significant” constitutional questions that needed to be explored further.

That could spell trouble even for a narrower version of the travel ban.

“Since they’ve shown their hand, I believe the administration would have an uphill battle writing a new executive order,” said Jay Holland, a civil rights attorney with Joseph Greenwald & Laake. “It’s like putting the toothpaste back into the tube.”

Rather than rewriting the order, Trump’s lawyers could simply ask the Supreme Court to review the unanimous decision from the Ninth Circuit.

The Supreme Court could either agree to hear the appeal and swiftly set a briefing schedule, or else the case would go back down for a full trial, where any rulings could also spark an appeals process that could eventually wind up back at the Supreme Court.

Some legal experts say a quick appeal by the Trump administration could backfire, because the fate of the order at the high court is uncertain.

The Supreme Court is currently short-handed, with an even split between the court’s conservative and liberal wings. Only four justices are needed to agree to hear the case, but a 4-4 decision on the appeal would affirm the lower court’s ruling.

The justices would not be deciding the merits of the immigration order itself. Rather, they would be considering whether it should be frozen while the executive order makes its way through the judicial system.

If the administration wanted more time to put together its argument in favor of the policy — or to give the Senate time to confirm Trump’s Supreme Court nominee, Neil Gorsuch — they would have a third option.

The process, known as “en banc,” would task the entire 11-judge appeals court at the Ninth Circuit to review the ruling from the three-judge panel. The White House has 14 days to make the decision on that option, in which legal briefs would be due over the next two months and could result in another hearing.

But that tactic would only make sense if the administration believes it would have a better shot at winning an appeal at a later date, as legal experts say the administration is unlikely to get a different decision from the 11-judge panel.

The administration could use en banc if they “wish to use it as a tool to drag out the process,” Holland said. “But the Ninth Circuit is known to be fairly liberal, and I don’t think the administration would like its chances.”