With the collapse of the Qing dynasty, Shanxi became part of the newly established Republic of China. From 1911–1949, during the period of the Republic of China's period of rule over mainland China, Shanxi was mostly dominated by the warlord Yan Xishan until Communists took full control in 1949; Communists had already set up secret bases in 1936, but did not completely overturn Yan and the KMT until 1949. Early in Yan's rule he decided that, unless he was able to modernize and revive the economy of his small, poor, remote province, he would be unable to protect Shanxi from rival warlords. Yan devoted himself to modernizing Shanxi and developing its resources during his reign over the province. He has been viewed by Western biographers as a transitional figure who advocated using Western technology to protect Chinese traditions, while at the same time reforming older political, social and economic conditions in a way that paved the way for the radical changes that would occur after his rule.