refactor geolocation stuff