The Fatimids with some exceptions were known for their religious tolerance and their observance of local Muslim, Coptic and indigenous Egyptian festivals and customs. Under the Ayyubids, the country for the most part continued to prosper. The Mamluks of Egypt (AD 1258–1517) as a whole were, some of the most enlightened rulers of Egypt, not only in the arts and in providing for the welfare of their subjects, but also in many other ways, such as efficient organisation of law and order and postal services, and the building of canals, roads, bridges and aqueducts. Though turbulent, often treacherous and brutal in their feuds, and politically and economically inept, the later Mameluks maintained the splendour and artistic traditions of their predecessors. The reign of Kait Bey (1468-1496) was one of high achievement in architecture, showing great refinement of taste in the building of elegant tombs, mosques and palaces. It was a period in which learning flourished. Their rule is generally regarded as one under which Egyptians, Muslims and Copts, greatly suffered. By the 15th century most Egyptians had already been converted to Islam, while Coptic Christians were reduced to a minority. The Mamluks were mainly ethnic Circassians and Turks who had been captured as slaves then recruited into the army fighting on behalf of the Islamic empire. Native Egyptians were not allowed to serve in the army until the reign of Mohamed Ali. Historian James Jankwoski writes:  Egyptians under the Ottoman Turks from the 16th to the 18th centuries lived within a social hierarchy similar to that of the Mamluks, Arabs, Romans, Greeks and Persians before them. Native Egyptians applied the term "atrak" (Turks) indiscriminately to the Ottomans and Mamluks, who were at the top of the social pyramid, while Egyptians, most of whom were farmers, were at the bottom. Frequent revolts by the Egyptian peasantry against the Ottoman-Mamluk Beys took place throughout the 18th century, particularly in Upper Egypt where the peasants at one point wrested control of the region and declared a separatist government. The only segment of Egyptian society which appears to have retained a degree of power during this period were the Muslim "'ulama" or religious scholars, who directed the religious and social affairs of the native Egyptian population and interceded on their behalf when dealing with the Turko-Circassian elite. It is also believed that during the time of Ottoman period of Egypt, native Egyptians were allowed and required to join the army for the first time since the Roman period of Egypt, particularly Copts who were civil servants at the time of Mohammed Ali Pasha.