The new U.S. plan to spend $6 billion fighting Ebola has a hidden agenda that aid workers approve of: not only stamping out the epidemic in West Africa, but starting to build a health infrastructure that can prevent this kind of thing from happening again.

President Barack Obama's $6.18 billion request is an enormous amount of money — six times what the U.S. has already committed and far more even than what the World Health Organization says is needed.

Most is going for full frontal assault on Ebola — one that hasn’t really gotten off the ground yet, months into an epidemic that has been out of control despite an outcry from international groups and governments alike.

But billions are also being quietly allocated to building a health care system in the countries suffering the most — a less sexy approach that could prevent another epidemic in the future.

Most aid groups are focused on eradicating the virus, which has infected at least 13,000 people, probably more, and killed at least 5,000 of them. That’s where the public support is; donors and taxpayers alike prefer to focus on a specific goal, and an emergency always gets attention.

“Had we had those things in place, we would have detected this a lot earlier."

“We are not really a developmental organization,” said Dr. Armand Sprecher of Médecins Sans Frontières (Doctors Without Borders), one of the main groups fighting Ebola in West Africa. MSF focuses on providing targeted medical care.

And while that has to be the first priority, it’s important to keep an eye on the long game, says Dr. Raj Panjabi, a founder and CEO of Last Mile Health, an aid group focused on helping people in the most remote corners of the world. “The goal has to be to not just contain Ebola,” Panjabi told NBC News.

Ebola spread silently in villages and remote communities where there were no health care workers to diagnose Ebola and no way for them to report it even if they did catch it. “Had we had those things in place, we would have detected this a lot earlier,” said Panjabi.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

“We know that we could have made a difference there. It’s unfortunate, because we could have spent tens of millions of dollars to establish community health workers in every village, doctors in every hospital. But because we haven’t done enough of that, now we are going to spend billions of dollars.”

Decades of civil war in the region ravaged what health care system did exist in Liberia, Sierra Leone and Guinea. According to the World Bank, Liberia and Sierra Leone have about one doctor per 100,000 people. Guinea has just 10 doctors for every 100,000 people. Compare that to most U.S. states, with at least 200 doctors per 100,000 people and more like 400 per 100,000 in Maryland and Massachusetts.

It means not only that people don’t get medical care, but that they don’t trust it. The virus spread as people stayed home to care for their loved ones, as villagers drove away health care workers coming to educate them about the virus, and as frightened victims slipped into the forests rather than trust clinics they saw as places of death, not of salvation.

WHO says only 22 percent of the 4,707 beds needed to treat Ebola in the three countries are in place. “One of the biggest obstacles to opening more beds is lack of skilled staff trained in infection prevention and control,” WHO said this week. Each treatment center with 50 to 120 beds needs 25 to 35 international health care workers who are expert in clinical care and infection prevention and control, as well as 200 to 250 national staff.

“The Ebola situation … lays bare all the weaknesses in our system,” said virus expert Dr. Daniel Bausch of Tulane University’s Ebola task force. Fixing these weaknesses, he told reporters at a meeting of tropical disease experts, will be “an incredible task.”

“We have a sick patient who needs urgent care."

“We have a sick patient who needs urgent care,” Bausch said.

However, there’s a sneaky way to fit in this longer-term goal, and that’s piggybacking on clinical trials of new drugs and vaccines. It’s a popular avenue — the National Institutes of Health has stepped up clinical trials of several experimental vaccines and treatments for Ebola, and WHO is promising something should be ready to use by next year.

“We hope for kind of a Marshall Plan for West Africa,” said Bausch. Like the initiative that poured $17 billion in U.S. funding into a Europe devastated by World War II, a post-Ebola plan could give the region the shot in the arm that it needs, he said. “These countries that been through years of civil war, (also suffer from) a lack of funding,” Bausch said. “We have seen funding fall off. It’s always hard to keep funding up.”

Clinical trials require hospitals and clinics, and trained doctors and nurses, and clear organization and lines of communication — all the things Liberia, Sierra Leone and Guinea lacked, and what they’ll need to conquer Ebola.

“We are also hoping that in the coming weeks and months, there will be additional capacities within the affected countries to be able to help out with clinical trials,” said Edward Cox of the U.S. Food and Drug Administration. FDA helps design the clinical trials and, ironically, most of the Ebola vaccines are being tested in the Western world — the United States and Britain — because there’s just no way to test them in the affected countries.

If Congress grants Obama’s request, that kind of money will start flowing in.

Part of the $1.8 billion that would go to the Centers for Disease Control and Prevention be earmarked to “establish global health security capacity in vulnerable countries to prevent, detect, and rapidly respond to outbreaks before they become epidemics by standing up emergency operations centers; providing equipment and training needed to test patients and report data in real-time; providing safe and secure laboratory capacity; and developing a trained workforce to track and end outbreaks before they become epidemics,” the White House says in a fact sheet.

“This will help limit the spread of Ebola beyond Liberia, Sierra Leone, and Guinea to other vulnerable nations."

“These are the same activities that are necessary to combat the spread of Ebola and reduce the potential for future outbreaks of infectious diseases that could follow a similarly devastating, costly, and destabilizing trajectory.”

Similarly, $1.98 billion to USAID would be spent on “global health security activities to prevent Ebola from spreading," including training people and providing communications and testing capacity.

“This will help limit the spread of Ebola beyond Liberia, Sierra Leone, and Guinea to other vulnerable nations and will increase preparedness and response capacity for future outbreaks,” the White House said.