In 1129, Emperor Gaozong designated the site at Hangzhou (known then as Lin'an) to be the temporary settlement of the court, but it was not until 1132 that it was declared the new Song capital. Hangzhou and Nanjing were devastated by the Jin raids; both cities were heavily repopulated with northern refugees who outnumbered the remaining original inhabitants. Hangzhou was chosen not only for its natural scenic beauty, but for the surrounding topographic barriers of lakes and muddy rice-fields that gave it defensive potential against northern armies comprising mostly cavalry. Yet it was viewed by the court as only a temporary capital while the Song emperors planned to retake Kaifeng. However, the rapid growth of the city from the 12th century to the 13th necessitated long-term goals of residency. In 1133 the modest palatial residence of the imperial family was improved upon from a simple provincial lodging to one that at least accommodated strolls with new covered alleyways to deflect the rain. In 1148 the walls of the small palace compound were finally extended to the southeast, yet this was another marginal improvement.