Rats have a reputation (arguably not fully earned) for spreading disease. But in the southeastern African nation of Mozambique, rats are actually helping to fight against illness—and doing so even more effectively than some medical technologies.

A Belgium-based nonprofit is coordinating efforts to train and distribute huge rats that detect tuberculosis present in patient-supplied samples using their excellent sense of smell. According to Newsweek, the kitten-sized rodents have “raised the detection rate on average by about 50%, and in some labs by as much as 80%.”

The rats are welcome help in a country where around 60,000 people were infected with tuberculosis in 2014, and one in 10 adults is HIV positive, raising their risk for opportunistic infection. The rats are reportedly able to detect the disease more quickly than conventional lab methods and can identify positive samples that are often missed by typical methods of screening.

Plus, they’re cost effective. Each rat has a life span of about eight years and requires between $6,700 and $8,000 to train, according to the Guardian. The cumulative costs are way lower than, say, a diagnostic devise that could cost up to $17,000 each.

How do you train an animal to do work normally performed by sophisticated tests and technologies? It starts with picking the right kind of rodent: African giant pouched rats are smart and big enough to capture and train, and they’ve got a highly sensitive snout. Then you’ve got to teach them what to look for and how to alert human medical professionals. As James Pursey, who is involved in the program, explained to Newsweek:

“Once you have isolated a type of scent - with tuberculosis its the smell the metabolism of the bacteria give off - you can train the sense-detecting animals to identify them through a standard method - a click. You let them know when they’re near the scent by giving them a click and they get some food. The sample that isn’t the target sense means they don’t get a click or food. So you introduce lots of smells, reduce the strength of the target smell, and over nine months they are trained to instantly detect the target scent.”

After initial lab testing, sputum samples are placed in a glass cage with a trained rat, which then notifies a technician if TB is detected by placing its nose in a designated hole. The rats can do in 20 minutes the work one lab technician would spend 2 days performing, which means that patients can start treatment sooner.

The group spearheading the project, which began in 2013, is Anti-Personnel Landmines Detection Product Development. They first began training this variety of rats to detect land mines. Now, they hope to soon spread the TB-sniffing rodent resource to other countries battling the disease.