The legacy of the Chinese hukou system may be traced back to the pre-dynastic era, as early as the 21st century BC. In its early forms, the household registration system was used primarily for the purposes of taxation and conscription, as well as regulating migration. Two early models of the hukou system were the xiangsui and baojia systems. The xiangsui system, established under the Western Zhou Dynasty (circa 11th-8th centuries BC) was used as a method of organizing and categorizing urban and rural land. The function of the baojia system, propagated by Lord Shang Yang of the 4th century BC, was to create a system of accountability within groups of citizens: if one person within the group violated the strict rules in place, everyone in the group suffered. This structure was later utilized and expanded upon during the Qin Dynasty (221-207 BCE) for the purposes of taxation, population control, and conscription.