Napoleon staged a coup in 1799 and established the Consulate government with himself as First Consul for 10 years. In 1802 he was elected First Consul for Life, effectively making France a dictatorship under his rule. During his time in power Napoleon enacted several reforms including restoring order, improving infrastructure, land reform, civil service reform, establishing the Continental System, and creating the Napoleonic Code.