Extract geonames-to-qa conversion into function