A fortified building for the defence of a town or district, doubling as the private residence of a baron in the Middle Ages. Although also called ‘castles’, Celtic hill-forts, Roman camps, and Saxon burhs were designed to provide refuge for whole populations; archaeological evidence suggests that in England fortified private residences date from the 9th century. The ‘motte and bailey’ design of the 11th century comprised a palisaded ‘motte’ (a steep-sided earthen mound) and a ‘bailey’ (an enclosure or courtyard) separated from the motte by a ditch. Both were surrounded by a second ditch. Initially timber-built, and often prefabricated for rapid assembly, many were later rebuilt in stone. Design modifications in the 12th century included stone tower keeps to replace the motte. The keep (the rounded form was called a shell keep) combined strong defence with domestic quarters. The need to extend these quarters meant that the courtyard had to be protected by a line of towers joined by ‘curtain’ walls. In the 12th century the concentric castle (one ring of defences enclosing another) was developed from the model of the castles built by the Crusaders, who themselves had copied the Saracens. At the end of the 13th century, Edward I of England, following a policy of subduing north Wales, built a series of castles, including those at Caernarvon, Conway, Harlech, and Beaumaris. Design improvements saw the further development of rounded towers, which were more difficult to undermine, machicolations, which enabled objects to be dropped or poured on the besiegers, massive gatehouses, and refinements to the battlements, or crenellations, along the walls. The invention of cannon had made castles obsolete for defensive purposes by the middle of the 16th century.