fixes tiny city building bug, some refactoring