With the coming of the new towns and cities, social life became more complex. People from far and near began to come to the urban centres to sell their products and get their needs. It also gave the people an opportunity to exchange ideas. Then they started questioning the old faiths and rituals. To face these challenges, the Brahmins formulated a code of conduct.
The rules that people had to keep in their day-to-day life were included in this code. These rules were to be rigidly observed by the common people, but only less rigidly by Brahmins. From 500 BC, these rules were published as Sanskrit books. They were known as Dharmasutras and Dharmasastras.