The Imperial Council or Imperial Divan (Ottoman Turkish: ديوان همايون, romanized: Dîvân-ı Hümâyûn), was the de facto cabinet of the Ottoman Empire for most of its history. Initially an informal gathering of the senior ministers presided over by the Sultan in person, in the mid-15th century the Council's composition and function became firmly regulated. The Grand vizier, who became the Sultan's deputy as the head of government, assumed the role of chairing the Council, which comprised also the other viziers, charged with military and political affairs, the two kadi'askers or military judges, the defterdars in charge of finances, the nişancı in charge of the palace scribal service, and later the Kapudan Pasha, the head of the Ottoman Navy, and occasionally the beylerbey of Rumelia and the Agha of the Janissaries. The Council met in a dedicated building in the Second Courtyard of the Topkapi Palace, initially daily, then for four days a week by the 16th century. Its remit encompassed all matters of governance of the Empire, although the exact proceedings are no longer known. It was assisted by an extensive secretarial bureaucracy under the reis ül-küttab for the drafting of appropriate documents and the keeping of records. The Imperial Council remained the main executive organ of the Ottoman state until the mid-17th century, after which it lost most of its power to the office of the Grand Vizier. With the Tanzimat reforms of the 19th century, it was eventually succeeded by a Western-style cabinet government, the Council of Ministers.