Factors contributing to the formation of villages