Refactoring in city.py