 After China was reunified by the Song dynasty (960–1279), major changes in society—in particular urbanization, the creation of a market economy, and the rise to prominence of new classes, especially in the southeastern regions—led to major transformations in religion. The institution of “lay associations”, whose main function was (in addition to performing various meritorious actions) supporting the local temple, was especially important in the development of Daoism, and at the same time in furthering the incorporation of cults to local deities and saints into the Daoist pantheon and liturgy.