When there was a legal dispute about family or financial matters, it would be handled in a court headed by a "qadi" (judge). These judges also had a legal education, and they were appointed to their post by the ruler. In simple cases, qadis would pronounce a verdict based on their own knowledge of sharia. In more difficult cases, they would express the details of the case in general terms and ask a mufti for his legal opinion.