During the Song dynasty, ordinary clans began to organize themselves into corporate units and produce genealogies. This trend was led by the poet Su Shi and his father. As competition for resources and positions in the bureaucracy intensified, individuals used their common ancestry and surname to promote solidarity. They established schools to educate their sons and held common lands to aid disadvantaged families. Ancestral temples were also erected to promote surname identity. Clan cohesion was usually encouraged by successive imperial governments since it aided in social stability. During the Qing dynasty surname associations often undertook extrajudicial roles, providing primitive legal and social security functions. They played important roles in the Chinese diaspora to South-East Asia and elsewhere, providing the infrastructure for the establishment of trading networks. In southern China, however, clans sometimes engaged in armed conflict in competition for land. Clans continued the tradition of tracing their ancestry to the distant past as a matter of prestige. Most of these origin myths, though well established, are spurious.