geolocations functions refactored