Refactoring geolocation, speeding up performance