Pingyao has been able to preserve its character and traditional Chinese buildings by going bankrupt. During the Ming and Qing dynasties, Pingyao was an affluent banking center. This wealth was exhibited in the Ming and Qing architecture of the courtyard houses, temples, and over 3,000 historic shops that inhabit the city. But when the Qing dynasty defaulted on its loans, it abdicated and left the banks empty. The country's finances were transferred to Shanghai and Hong Kong and the city was left to become a backwater. This transfer of money, and subsequent modernization, is what has saved the history and charm of this historic old town. The town was made a UNESCO World Heritage Site in 1997.