The Trump administration is struggling to figure out how to enforce U.S. laws and keep keeping families together. The matter is made more complex and difficult because of loopholes and restrictions in current law.

But it doesn’t have to be difficult and confusing. Congress can and should ensure that families are kept together and U.S. laws are well-enforced.

How so? Here’s a checklist for Congress:

Step 1: Close the Flores loophole. In 1997, the Clinton administration entered into the Flores Settlement Agreement, which allowed the government to hold unaccompanied children in detention for only 20 days, after which they must be released into the “least restrictive” environment possible. In 2016, the 9th U.S. Circuit Court of Appeals decided this settlement also applied to accompanied children.

When a family crosses the border illegally today, the U.S. government must release the child from detention after 20 days, even if the parents are still being detained. After being caught sneaking across the border, some parents claim asylum to avoid being deported, and these asylum claims can take months to assess. So the choice for the government is to detain the parents until their case is completed but release the child after 20 days, or to release the entire family, knowing many will never show up at their immigration court hearing.

A simple fix here is for Congress to allow families to be detained together by overriding the Flores settlement. Congress should provide money for appropriate detention facilities.

Step 2: Fix the asylum process. Violence in Central America and lax enforcement by the Obama administration encouraged individuals to come to the U.S. As a result, the number of asylum claims has increased dramatically. Credible fear interviews—Department of Homeland Security interviews of asylum-seekers before they get to an immigration judge—that were referred to an immigration judge increased from 5,100 in 2008 to almost 92,000 in 2016.

Not only are claims increasing, but fewer claims are found to have met the definition of asylum—28,000 grants of asylum were made in 2012, but only 20,455 grants in 2016.

There are several fixes to this. First, the U.S. should demand that asylum-seekers first seek asylum at our consulates in Mexico. Since they are not in the U.S., no one is detained and it’s also easier for legitimate asylum-seekers to make it there.

Those who illegally cross into the U.S. and then claim asylum should have to explain why they didn’t seek asylum from other governments such as Mexico and why they didn’t apply for asylum at a U.S. consulate. The U.S. also should pursue safe third-country agreements with countries such as Mexico, Costa Rica, and Panama, so asylum-seekers do not bypass those countries on the way to the U.S.

Step 3: Fix crucial loophole. The well-meaning 2008 William Wilberforce Trafficking Victims Protection Reauthorization Act contains a provision that requires unaccompanied children from countries other than Mexico to be released and put into the standard immigration court system. Congress should close this loophole so unaccompanied children from any country can be quickly returned to their family in their home country.

Step 4: Support immigration courts and adjudication. Partly because of the broken process and loopholes discussed above, U.S. immigration courts have been overwhelmed. The average wait time for court appearances has increased from 438 days in 2008 to 721 days now. DHS asylum officers don’t have the time to get through pending claims, and the rest of the immigration court system is stretched to the breaking point.

Congress should appropriate funds for more immigration court judges, prosecutors, and support staff as well DHS asylum officers. The system needs all these positions staffed appropriately if it is to function effectively. Congress also should consider housing some of these new immigration officials closer to the border or detention facilities.

The U.S. can enforce its laws and keep families together but only if Congress acts. Indeed, several bills, including one by Sen. Ted Cruz, R-Texas; another by Sen. Thom Tillis, R-N.C.; and yet another from Rep. Mark Meadows, R-N.C., tackle at least some of these points. The new executive order by the administration cannot solve this problem. Rather than getting stuck on amnesty bills, Congress should turn to solving these issues.