refactor retriving city code