Game of Thrones is a series known for its nearly 6,000 onscreen deaths. But in the finale, the king’s new advisors suggest taking aim at a deadlier off-screen threat: poor water and sewer infrastructure.

In a final scene, the new king’s small council is debating infrastructure investment priorities. Tyrion Lannister, the hand of the king, suggests overhauling the capitol’s water infrastructure.

“It is my theory,” Lannister says, “based on my years of work on the Casterly Rock sewers, that clean water leads to a healthier population.”

Lannister is onto something: clean drinking water and modern sewage systems have been two of history’s most life-saving innovations.

Grist thanks its sponsors. Become one.

King’s Landing, the capitol city of Westeros, is infamous for its poor sewage. People dispose of their bathroom business by throwing it out the window, giving the city its signature smell. In season 5, Olenna Tyrell remarks that “you can smell the shit from five miles away.”

The real-world history of sewage isn’t much better. In medieval England, toilets were sometimes just holes in the floor that emptied into drainage ditches. In the 1850s, London’s crude sewers dumped raw sewage into the Thames, leading to disasters like “The Great Stink” of 1858, and cholera outbreaks that killed thousands. During that period, a doctor famously traced a cholera outbreak back to a single feces-contaminated water pump, which was responsible for more than 100 deaths. (That doctor, now known as a “father of modern epidemiology,” also happened to be named John Snow!)

Grist thanks its sponsors. Become one.

Today, modern sewage and drinking water improvements are partially credited with raising the world’s life expectancy over the last century. But even today, more than 2 billion people worldwide drink water tainted with sewage. The World Health Organization estimates that improving sewage and water safety could prevent 6 percent of of the world’s deaths.

Of course, good ideas aren’t always well-received. In 1850s London, officials claimed the cholera outbreaks were merely an act of god. At the small council meeting in Westeros, Bronn responds with his own counter-theory: “The strong live and the weak don’t.” Instead, he suggests, they should rebuild the brothels.