Brick sewers had been built in London from the 17th century when sections of the Fleet and Walbrook rivers were covered for that purpose. In the century preceding 1856, over a hundred sewers were constructed in London, and at that date the city had around 200,000 cesspits and 360 sewers. Some cesspits leaked methane and other gases, which often caught fire and exploded, leading to loss of life, while many of the sewers were in a poor state of repair. During the early 19th century improvements had been undertaken in the supply of water to Londoners, and by 1858 many of the city's medieval wooden water pipes were being replaced with iron ones. This, combined with the introduction of flushing toilets and the rising of the city's population from just under one million to three million, led to more water being flushed into the sewers, along with the associated effluent. The outfalls from factories, slaughterhouses and other industrial activities put further strain on the already failing system. Much of this outflow either overflowed, or discharged directly, into the Thames.