Under the Ayyubids and the later Mamluks, the Qasaba avenue became a privileged site for the construction of religious complexes, royal mausoleums, and commercial establishments, usually sponsored by the sultan or members of the ruling class. This is also where the major souqs of Cairo developed, forming its main economic zone of international trade and commercial activity. As the main street became saturated with shops and space for further development there ran out, new commercial structures were built further east, close to al-Azhar Mosque and to the shrine of al-Hussein, where the souq area of Khan al-Khalili, still present today, progressively developed. One important factor in the development of Cairo's urban character was the growing number of "waqf" establishments, especially during the Mamluk period. Waqfs were charitable trusts under Islamic law which set out the function, operations, and funding sources of the many religious/civic establishments built by the ruling elite. They were typically drawn up to define complex religious or civic buildings which combined various functions (e.g. mosque, madrasa, mausoleum, sebil) and which were often funded with revenues from urban commercial buildings or rural agricultural estates. By the late 15th century Cairo also had high-rise mixed-use buildings (known as a "rab"', a "khan" or a "wikala", depending on exact function) where the two lower floors were typically for commercial and storage purposes and the multiple stories above them were rented out to tenants.