During the late 1800s and early 1900s, cities in the United States grew rapidly due to large numbers of immigrants and migrants from rural areas. This caused overcrowding and poor living conditions in cities. Problems included cramped housing known as tenements, lack of transportation and sanitation infrastructure, disease outbreaks, high crime rates, and poverty. In response, cities implemented reforms such as building codes, water treatment, garbage collection systems, police forces, and firefighters. Labor unions also advocated for workers' rights to address low wages and long hours. Corruption was widespread in political machines that controlled many city governments; civil service reforms in the 1880s aimed to establish merit-based hiring in the public sector.