their armies and built centrally administered states along the lines of Western models. In the Ottoman empire, the first such changes in the legal sphere involved placing the formerly independent waqfs under state control. This reform, passed in 1826, enriched the public treasury at the expense of the waqfs, thereby depleting the financial support for traditional Islamic legal education. Over the second half of the 19th century, a new hierarchical system of secular courts was established to supplement and eventually replace most religious courts. Students hoping to pursue legal careers in the new court system increasingly preferred attending secular schools over the traditional path of legal education with its dimming financial prospects. The Tanzimat reforms of the 19th century saw reorganization of both Islamic civil law and sultanic criminal law after the model of the Napoleonic Code. In the 1870s, a codification of civil law and procedure (excepting marriage and divorce), called the Mecelle, was produced for use in both Sharia and secular courts. It adopted the Turkish language for the benefit of the new legal class who no longer possessed competence in the Arabic idiom of traditional jurisprudence. The code was based on Hanafi law, and its authors selected minority opinions over authoritative ones when they were felt to better "suit the present conditions". The Mecelle was promulgated as a qanun (sultanic code), which represented an unprecedented assertion of the state's authority over Islamic civil law, traditionally the preserve of the ulema. The 1917 Ottoman Law of Family Rights adopted an innovative approach of drawing rules from minority and majority opinions of all Sunni madhhabs with a modernizing intent. The Republic of Turkey, which emerged after the dissolution of the Ottoman Empire, abolished its Sharia courts and replaced Ottoman civil laws with the Swiss Civil Code, but Ottoman civil laws remained in force for several decades in Jordan, Lebanon, Palestine, Syria, and Iraq. Nation states Westernization of legal institutions and expansion of state control in all areas of law, which began during the colonial era, continued in nation-states of the Muslim world. Sharia courts at first continued to exist alongside state courts as in earlier times, but the doctrine that sultanic courts should implement the ideals of Sharia was gradually replaced by legal norms imported from Europe. Court procedures were also brought in line with European practice. Though the Islamic terms qadi and mahkama (qadi's/Sharia court) were preserved, they