In order to do this towns formed what are called communes . Thus towns formed communes , a legal basis for turning the cities into self-governing corporations . Although in most cases the development of communes was connected with that of the cities , there were rural communes , notably in France and England , that were formed to protect the common interests of villagers .