In recent weeks, the term “kids in cages” began trending on social media as news broke that the Biden administration was reopening a temporary influx facility for unaccompanied migrant children in Carrizo Springs, Tex. Progressive advocates were quick to condemn the administration, while conservative hard-liners claimed that it showed President Donald Trump’s approach had been right all along.

The administration does need to move fast to resolve a situation that is once again leaving children in Border Patrol holding cells made for adults. But if President Biden is going to avoid the mistakes of his predecessors and make good on his promise to manage migration in a lasting and humane way, officials will have to make some hard decisions, including setting up more emergency housing for the children who are turning up at the border in large numbers. Doing so will allow the administration to make systemic changes to respond to the ways migration patterns have changed in the last decade.

Yes, more migrants are coming to the southwest border in fiscal year 2021, with encounters more than double the same period in 2020. Among those arriving are thousands of children without a parent or legal guardian, including almost 6,000 in January alone. This is the most that border officials have encountered since the last peak in 2019.

And yes, some of these children are ending up in holding facilities that are not age-appropriate. Biden halted Trump’s policy of turning away unaccompanied minors, allowing them to enter and plead their case in immigration courts. Unfortunately, with coronavirus restrictions, there aren’t enough beds in proper Health and Human Services shelters to house these children while they wait for the government to place them with vetted family members within the United States.

That is why the Texas facility — with its rows of soft-sided tents and temporary buildings — was reopened, and others are being prepared to open soon.

The Border Patrol stations that end up housing some of the children are certainly no place for children. They are essentially police precincts with cement floors. HHS shelters are quite different; they have mental health and medical care, immigration case managers, classrooms and playgrounds, and staff trained to deal with children, many of whom have suffered trauma.

Influx facilities, like the tents in Texas, serve as a necessary middle ground between those two types of facilities that can be brought online relatively quickly.

To understand how we got here, it’s important to appreciate that the dynamics at the border have rapidly evolved in the past several years. For decades, most migrants at the southern border were adult Mexican men, not seeking asylum but looking for work. Since they were immediately deportable, the process and infrastructure at the border was set up to do just that — book them at local Border Patrol stations and send them back to Mexico in as little as a few hours, but rarely more than a few days.

That changed about seven years ago, when large numbers of Central American children fleeing violence and poverty began showing up at border stations to seek asylum, some with their parents and some without. This evolved into a crisis for the Obama administration in fiscal year 2014, as the number of unaccompanied children swelled to 68,000, all of them seeking protection in the United States and many with complex asylum cases that needed to be processed in the immigration courts.

Border Patrol facilities, not built or equipped for the influx, were suddenly dealing with hundreds of children and families. The Obama administration first created overflow border facilities with the chain-link fences that immigration advocates criticized as cages, and later put families into detention. Eventually, after some court orders, it released families into community shelters until they were able to go to destinations in the United States to pursue their asylum cases, and it released children to the network of HHS shelters.

The Trump administration, facing the same challenges of increasing families and children at the border and overcrowding in facilities, did a complete about-face: Officials did anything they could to discourage migrants from coming, including separating parents and children. But this had the effect of putting even more children into the system and led them to open the first influx tents. These measures didn’t reduce the desire of migrants to come or improve the situations they were fleeing. According to press reports, the Biden administration believes this year could see more children at the border than 2014.

The pictures of children and families in these overcrowded facilities, both during the Obama administration and again under Trump, became symbolic of a border that seemed “out of control” and a government unable to manage it. The demands to release the children — into the United States from many on the left, and back home from many on the right — obscured the complexity of managing changing migration at the border. Without beds, judges and overall capacity in the system to handle so many children, when the numbers increase rapidly, the system fails.

There has been a sustained change in the flow of people arriving at the border; we’re eight years into this shift, and the old processes and facilities no longer work. Systematic reform would help address this new paradigm.

Immediately, the Biden administration should open the influx facilities to the press and advocates so they can see the improvements officials claim to have made to make them more humane. Working with nongovernmental organizations that have expertise in helping children could help lead to faster ways of getting children to their sponsors and managing their cases through the system.

In the medium term, it should expand the influx facilities and bring in more immigration and health personnel as well as nonprofits that can serve children. These changes will probably take several months but should stabilize the situation by adding capacity. It will require federal agencies to get new contracts and agreements in place, potential regulatory changes, and the construction of new facilities or renovation and repurposing of others. In short, there are very few “quick fixes.”

Other changes might require congressional action. For example, the law could be amended to change the definition of “unaccompanied” to allow relatives who arrive with children, but who are not parents (grandparents, siblings, aunts or uncles), to remain together rather than being separated, if it is not a danger to the child. Or, provide a new process for arriving families and children to allow asylum officers to decide their cases in a fair but expedited process at the border. Legislation may be necessary to create a new system for asylum-seeking migrants.

In the long run, Biden has said he wants to tackle the “root causes” of migration from countries like Guatemala, El Salvador and Honduras. This is important, but no one believes that conditions on the ground such as poverty, famine, gangs, crime, extortion, corruption and lack of job opportunities are going to be “fixed” in four or eight years. We should also be thinking about surge capacity to address future changes in migration, a sort of Federal Emergency Management Agency for immigration, providing humanitarian needs and operational integration before it becomes a crisis.

Biden has a chance to make real and lasting change and develop a new paradigm for addressing migration in the region — one that treats migrants humanely, while also enforcing the law. If his team is working on that, then that would be the real end to “kids in cages.”