refactoring state and city