Their activity, prominence, and number waxed and waned according to the city's periods of prosperity and decline. The peaks of such prosperity were during the Almoravid and Almohad periods (11th-13th centuries), the Saadian period (16th century), and under certain later Alaouite sultans. In the 20th century, however, the major social changes brought about by French colonial rule (1912-1956), such as the expansion of the city outside its historic walls and the rural exodus across the country, has resulted in many funduqs being converted to low-cost permanent housing, and the steady degradation of their architectural fabric.