In cities, bees get a balanced diet, face fewer predators, and avoid pesticides. And now, companies are providing native wildflower waystations, too.

When Brian Peterson-Roest decided to leave suburban Lake Orion, Michigan, he thought his beekeeping days were numbered. He was moving to Detroit. Who had ever heard of keeping bees in a city?

But his thinking changed on a trip to New York City, where saw hives of bees living in harmony with passersby in Manhattan’s Battery Park.

“I was like, why can’t I do bees in the city?” he says. “There’s so many green spaces and urban gardens and parks and abandoned lots in Detroit compared to most large cities. It just made sense.”

Two years after moving, in 2016, Peterson-Roest started keeping bees on the rooftops of friends’ businesses in Detroit. That year, he and his husband—who is also named Brian, though his last name is Roest-Peterson—co-founded Bees in the D, a nonprofit that promotes honeybee health and education. Today, Bees in the D manages 50 hives in the core of the city.

A non-native species that arrived in the United States with European settlers in the 17th century, honeybees are just one of 4,500 bee species in North America, says Matthew Shepherd, director of communications and outreach at the environmental nonprofit Xerces Society. They play a crucial role in the survival of crops—from tomatoes and blueberries to squash and almonds, a full third of our food—that require pollination to grow. Farmers have long trucked honeybee hives from field to field, using them like professional pollinators-for-hire.