White House aides and Department of Homeland Security officials are working on a legislative package aimed at closing "loopholes" in the immigration system that incentivize illegal migration, senior administration officials said Monday.

The reforms would ease restrictions on who law enforcement agents can detain and for how long because, the administration officials argued, smuggling organizations know well the limits facing border patrol agents who intercept illegal immigrants. That knowledge allows smugglers to exploit the system and encourages more illegal border crossings, the officials said.

The legislative package would also address weaknesses in the asylum-seeking process that create major backlogs of asylum cases in immigration courts due to overly broad definitions of what qualifies individuals for the status.

President Trump's team said the immigration debate in Congress has encouraged more illegal border crossings because resistance to fixing loopholes in the immigration system creates "magnets" that attract more illegal immigrants.

"What's creating these pull factors is the belief that there's going to be never-ending leniency from now until the end of time," one senior administration official said.

Trump took to Twitter on Sunday and Monday to lament the slow progress of congressional action on the Deferred Action for Childhood Arrivals program, which he attempted to end in early March before a court challenge temporarily prevented the administration from concluding it.

"These big flows of people are all trying to take advantage of DACA. They want in on the act!" Trump tweeted Sunday, referring to reports that a large group of Central Americans is traveling through Mexico in an effort to reach the U.S.

However, none of the Central Americans heading for the southern border would qualify for DACA protections, which the Obama administration extended to undocumented immigrants who entered the country illegally as children. To be eligible for DACA, applicants must have been "physically present" in the U.S. since at least 2012, according to U.S. Citizenship and Immigration Services.

But administration officials argued Monday that programs like DACA — not necessarily DACA itself — create the impression for prospective illegal immigrants that the government will extend similar protections for future groups of undocumented immigrants in the years ahead.

"When Congress is debating a large grant of a generous immigration benefit, that tends to be a major pull factor for new people to come illegally," a senior administration official said.

Lawmakers have struggled to arrive at an immigration consensus in the months since Trump announced he would end DACA. Democrats have objected to the administration's demands for deep cuts to legal immigration and new restrictions on family-based migration.

Trump, meanwhile, has grown frustrated with Democrats' refusal to provide adequate funding for his promised border wall.