An association of townspeople formed to provide mutual protection of trading practices. Religious guilds, mainly devoted to devotional, charitable, and social activities, were important in English towns and parishes throughout the Middle Ages. From the early 11th century merchants and traders combined to regulate trade. The merchant guilds they formed controlled markets, weights and measures, and tolls, and negotiated charters granting their towns borough status. They maintained the charitable work of the earlier religious guilds. However, their monopolistic character forced the small crafts and trades to form their own associations, craft guilds, before the end of the 12th century. Each craft had its own guild which set quality standards and evolved a hierarchy consisting of master, journeymen, and apprentices (serving for up to twelve years). Guilds declined from the 16th century, being unable to adapt to the emergence of new markets.