How?  When the dynasty in charge became to corrupt for the people to live with they simply killed their present leaders and replaced them with far less corrupt, and far more wary, new leaders but kept the same system of government.  It worked really well, but then came communism... oh, well!