refactored geolocation