The government is relying on some new technology - as well as a bit of luck - to track an outbreak of life-threatening listeria linked to Blue Bell ice cream products.

Texas-based Blue Bell Creameries recalled all its products this week as listeria was found in a variety of the company's frozen treats. The massive recall followed several smaller recalls as health officials across the country have rapidly worked to track the outbreak, which is so far linked to 10 listeria illnesses, including three deaths.

The investigation has been helped by technology called whole genome sequencing that maps all an organism's DNA. While the sequencing has been a staple of medical research, it has only recently been used regularly to track listeria outbreaks.

With help from that technique, federal and state officials realized the outbreak was not just a recent event - the ice cream had likely made people sick since 2010.

It gives officials hope that future outbreaks can be tracked faster, and more accurately.

"It is giving us a new power to investigate cold cases," the Centers for Disease Control and Prevention's Dr. Robert Tauxe said of the genome sequencing.

They wouldn't have gotten there without a bit of good fortune, too.

The first indication of listeria contamination in Blue Bell products came in January, when the South Carolina Department of Health and Environmental Control collected samples from a Blue Bell distribution plant as part of a random sampling program. The South Carolina officials had no reason to suspect the ice cream was contaminated, but unexpectedly found that two of Blue Bell's products contained high amounts of listeria.

South Carolina notified the Food and Drug Administration, setting off a chain of events that ended with Monday's massive recall:

- In testing prompted by the South Carolina discovery, the Texas Department of State Health Services found listeria in product samples from the Brenham, Texas, plant where Blue Bell is headquartered and the tainted ice cream was manufactured. Ice cream produced on that line was recalled.

- Samples of listeria matched the strains in patients who contracted listeria after eating Blue Bell ice cream in a Kansas hospital. Three of those patients have died. Further testing of Blue Bell products by Kansas health officials found listeria in products from a separate Blue Bell plant in Oklahoma, leading to another recall.

- More testing by the FDA and Blue Bell itself led to more recalls and, finally, Monday's total shutdown of all of the company's manufacturing plants.

Along the way, federal officials were able to track the samples to 10 illnesses going back five years - something they wouldn't have been able to confirm before they started using the whole genome sequencing to track listeria outbreaks in 2013.

That involved some luck, as well. Tauxe said CDC found possible matches going back that far in a national database of foodborne illness samples, but would need the actual samples themselves - cultured stool or blood taken from patients - to do the whole genome sequencing. The state labs had fortunately saved the samples, CDC did the tests, and they were able to confirm with much higher certainty that past listeria patients were connected to the current outbreak.

It's still unclear what was happening in the Blue Bell plants or how the listeria got there. The Food and Drug Administration, which is in charge of figuring out how the plant was contaminated, has so far released no information on the conditions of the plants or a suspected cause.

In past outbreaks, contamination has been the result of dirty equipment or unsanitary conditions in a plant. Listeria is a hardy bacteria found in soil and water that can be tracked into a plant or carried by animals. It can be very hard to get rid of once it contaminates a processing facility, partly because it grows very well in refrigeration.

Blue Bell says it is expanding its cleaning and sanitization system, beefing up its employee training, expanding its swabbing system by 800 percent to include more surfaces and sending daily samples to a microbiology laboratory for testing. The 108-year-old company said it will also test all products produced at its facilities before sending them out to retailers.

"It's a matter of doing the work and not making excuses," said Blue Bell spokesman Joe Robertson.