The consolidation of territorial states in Central Europe undermined the local customs and institutions that had shaped village life since the Middle Ages. By the end of the eighteenth century unitary law codes overrode rural customs. By distinguishing between public and private law, these codes stripped the organized village community of legal substance. Police and judicial functions once performed within the community were assumed by bureaucrats, and the state meddled with the use of local resources by liberalizing marriage and residence laws. Deprived of political autonomy, the village did remain the core economic and social unit in rural life, controlling access to communal forests and enforcing the rules of three-field agriculture. In the middle decades of the nineteenth century this limited autonomy was undermined as well. Freedom of contract, security of individual property, free transmission of property between generations, and commercialization of landed property struck at the ability of villages to control their material world in customary ways.