Most English counties were subdivided into smaller subdivisions called hundreds. Nottinghamshire, Yorkshire and Lincolnshire were divided into wapentakes (a unit of Danish origin), while Durham, Northumberland, Cumberland and Westmorland were divided into wards, areas originally organised for military purposes, each centred on a castle. Kent and Sussex had an intermediate level between their major subdivisions and their hundreds, known as lathes in Kent and rapes in Sussex. Hundreds or their equivalents were divided into tithings and parishes (the only class of these divisions still used administratively), which in turn were divided into townships and manors. In the 17th century the Ossulstone hundred of Middlesex was further divided into four divisions, which replaced the functions of the hundred. The borough and parish were the principal providers of local services throughout England until the creation of ad-hoc boards and, later, local government districts.