'A better system would allow us to keep families together': Border Patrol chief The Border Patrol commissioner spoke to ABC News in South Texas.

Border Patrol agents have faced a “huge challenge” over the past two weeks as the Trump administration vowed to separate families who crossed the southwest border illegally and then reversed course, according to Customs and Border Protection Commissioner Kevin McAleenan.

Asked whether he believes it was a mistake to separate families, McAleenan responded: "I'm saying a better system would allow us to keep families together. So we need to overcome court rulings and the current status of the law that don't allow us to do that effectively."

But, McAleenan said, the “current dialogue” tied to illegal immigration misses the larger issue: There’s a crisis of violence in Central America that has propelled a “surge of families and children” trying to sneak into the United States through Southern Texas in particular.

“It’s not about what’s happening at the border,” McAleenan told ABC News after meeting with border officials in McAllen, Texas. “It’s about what’s happening to these families that led them to make the decision in Central America to try [and get to the United States]. They’re in the hands of Mexican cartels, dangerous organizations, and then the dangers of the crossing. That piece has lost focus in the current dialogue.”

Last month, Attorney General Jeff Sessions announced a new “zero tolerance” policy in which every adult caught crossing the border illegally would be referred for prosecution. Because children can’t accompany their parents through the judicial system, that meant children were being separated from their families.

Images showing migrants sitting and sleeping behind chain-link fencing inside CBP facilities, along with heart-wrenching stories of separation, prompted a national outcry. CBP operates what McAleenan described as “very temporary” holding facilities, where migrants are detained while they’re identified, questioned and processed.

On Wednesday, President Donald Trump issued an executive order telling federal officials to keep migrant families together, even after they're transferred from CBP’s temporary holding facilities to the custody of Health and Human Services housing or ICE.

In light of the executive order, CBP has – at least for now – stopped referring family members for prosecution.

“The main guidepost is the welfare of the child,” while also enforcing the law, McAleenan said.

CBP plays a key role in making sure that the nearly 2,000 children who are now in HHS custody are able to be reunited with their families.

“It’s very important at the outset that we process them carefully, and capture their file in our electronic systems … so that if they have a parent, even if it’s a short period of time during the stay in our facility, they can be connected and reunited with their parents," the commissioner said. "We have that front-end process to ensure that the data is sound so that our partners at ICE and HHS know who the parents are and how they're related."

Nevertheless, men, women and unaccompanied minors are still separated inside CBP facilities.

“What we have to do is we have to protect them,” McAleenan said. “We can’t have certain groups of people with others – adult males with teenage girls.”

On Monday morning, ABC News visited CBP’s central processing center in McAllen, where about 1,300 migrants are currently being held.

McAleenan suggested CBP is working with the resources it has.

“This is the funding we have,” he said. “It’s a safe facility. You can actually see what’s happening through the transparent fencing.”

McAleenan disputed many of the reports alleging inhumane treatment, including reports that children would be taken from parents while the parents were showering or while at court.

“We have a careful script for our agents, there’s a tear sheet that’s handed to each parent, and then intent was to make it very clear what’s happening,” according to McAleenan. “These stories of subterfuge, of people telling false narratives to get people to relax, that wasn’t happening to my knowledge.”

While touring the McAllen facility on Thursday, ABC News saw no crying children – some children were watching cartoons on a large TV. In fact, the large warehouse-like facility was relatively quiet, and the only constant sound was the rustling of Mylar blankets that detainees used for warmth as they rested on large pads.

When children do cry in the facilities, “it’s really tough,” McAleenan said. “Seeing the families and children, and what they go through to get here. They’re putting themselves in the hands of the most violent criminal organizations in the Western hemisphere.”

He said he hopes the current “spotlight” on border issues “focuses attention” on what’s happening in Central America and “can be changed into a national conversation that helps us fix this [immigration-related] problem.”

ABC News' Brandon Chase contributed to this story.