He secured the Archbishopric of Cologne for his brother Ernest in 1583, and this dignity remained in the possession of the family for nearly 200 years. In 1597 he abdicated in favour of his son Maximilian I.  Maximilian I found the duchy encumbered with debt and filled with disorder, but ten years of his vigorous rule effected a remarkable change. The finances and the judicial system were reorganised, a class of civil servants and a national militia founded, and several small districts were brought under the duke's authority. The result was a unity and order in the duchy which enabled Maximilian to play an important part in the Thirty Years' War; during the earlier years of which he was so successful as to acquire the Upper Palatinate and the electoral dignity which had been enjoyed since 1356 by the elder branch of the Wittelsbach family. The Electorate of Bavaria then consisted of most of the modern regions of Upper Bavaria, Lower Bavaria, and the Upper Palatinate.