Aztec society was a highly complex and stratified society that developed among the Aztecs of central Mexico in the centuries prior to the Spanish conquest of the Aztec Empire, and which was built on the cultural foundations of the larger region of Mesoamerica. Politically, the society was organized into independent city-states, called altepetls, composed of smaller divisions (calpulli), which were again usually composed of one or more extended kinship groups. Socially, the society depended on a rather strict division between nobles and free commoners, both of which were themselves divided into elaborate hierarchies of social status, responsibilities, and power. Economically the society was dependent on agriculture, and also to a large extent on warfare. Other economically important factors were commerce, long-distance and local, and a high degree of trade specialization. Aztec society can trace its roots to Mesoamerican Origins. Their language, lifestyle, and technology were all impacted by contact with neighboring cultures. But, while they were impacted by various sources, they developed their own distinct social groupings, political structures, traditions, and leisure activities. Mesoamerica In the middle of the first millennium CE, the first waves of tribes speaking the forefather language of the Nahuan languages migrated south into Mesoamerica. They were nomadic hunter-gatherers and arrived in a region that was already populated by complex societies at a highly advanced technological level. Under the influence of classic Mesoamerican civilizations such as the Teotihuacanos, the Maya, the Totonacs and the Huastecs the proto-Aztecs became sedentary agriculturalists and achieved the same levels of technology as their neighbouring peoples. They held on to their language, many of their religious systems, and probably aspects of their previous social customs. Resultingly the foundations of "Aztec society" were developed as a synthesis between Mesoamerican societies and Aztec traditions, although today it cannot easily be discerned which parts come from where.