In the Middle Ages and early modern times, a multi-storey building with living and economic facilities. It was made of any material, most often on a quadrilateral plan, less often on an irregular plan. Adapted for defense in various ways by means of defense equipment: earth ramparts, moats, arrowslits, machicolations, overhanging bay windows. The defensive and residential tower was often standalone, and sometimes inside the fortified town or castle. With its extensive defensive program, it sometimes took the form related to the keep.