Geolocation code cleanup/refactor.