Added random city generation. Refactored relevant code duplication.