Plastic is demonized in today’s world for supposedly destroying the planet.

Dig a little deeper, however, and it will be easy to see how plastic is still vital to not just humans, but animals as well.

Take, for example, the case of the Scarlet Macaw in Mexico. With its populations and habitat decimated due to poaching and deforestation, the Scarlet Macaw is now in danger of going extinct. Only a few hundred are estimated to be alive in the wild today.

Conservationists in the Los Tuxtlas Biosphere Reserve in Veracruz, Mexico, have found a unique way to encourage macaws to begin safely mating once more.

According to a story featured by Defenders of Wildlife, scientists and activists have put their heads together to create habitats out of plastic barrels. These barrels, with holes cut into them and placed high in the treetops, are proving to be a fantastic home for macaws looking for some safe privacy to raise their young.

While at first more so-called “environmentally friendly” attempts were made by using large wooden boxes, they didn’t work.

According to the article on Defenders.org:

The decision was made to switch to plastic after bee swarms moved in, predators such as ring-tail cats and iguanas raided the nests, and they were flooded by rainwater. The barrels have a hole cut into the side for nesting parents to enter. To deter tree-climbing predators, tree trunks were lined with sheets of metal. The result is a cozy space with relative privacy for the macaws.”

Not only was plastic needed to help provide a safe home for the macaws, but even metal, in order to prevent predators from climbing the trees to get to the nests.

After reviewing footage from cameras placed in the trees, it has been determined that six nests are located in the plastic barrels, and one nest has appeared naturally in the reserve.

You can read the full story by Defenders of Wildlife here.