In 1868, the third Chinese Kapitan of Kuala Lumpur, Yap Ah Loy, emerged as leader, and became responsible for the survival and growth of this town. During the early times, Kuala Lumpur was beset with many problems, including the Selangor Civil War which devastated the town. It was also plagued by diseases and constant fires and floods. Kuala Lumpur was destroyed several times, but each time Yap rebuilt the town. He strove to develop Kuala Lumpur from a small, obscure settlement into a booming mining town. In 1880, the state capital of Selangor was moved from Klang to the more strategically advantageous Kuala Lumpur.