refactoring geolocation controller