The Qingli Reforms were the reform of 1043-1045 (the third to fifth Qingli years) led by Fan Zhongyan under Emperor Renzong of Song. The Northern Song had just closed the wars with the Western Xia, and the entrenched evils of redundant offices, redundant soldiers and redundant spending stood exposed; Renzong opened the Tianzhang Pavilion and issued a hand-edict for counsel, and Fan Zhongyan answered with the 'Ten Articles in Reply to the Edict' — clarifying promotion and dismissal, curbing privilege-broking, refining the examinations, choosing the right prefects and magistrates, ten measures with the overhaul of officialdom at the center, reaching also to agriculture, the military prepareness and the lightening of corvée. The court promulgated them in sequence: terms of review adjusted, the yin privilege of office by kinship curtailed, schools founded in the prefectures and counties, officials judged and advanced by record. The reform struck straight at the bureaucracy's interest — the attacks rose like hornets, the opposition working under the cry of 'faction'; Ouyang Xiu answered with his 'On Parties'. Fan Zhongyan and Fu Bi went out in succession to frontier posts, and within the year the reform was done. It was the Northern Song's first great attempt at institutional reform, the direct inspiration of Wang Anshi's change two decades later; and the Qingli-era command that prefectures and counties found schools made the official academies and the academies (shuyuan) flourish — the pattern of Song learning laid here.