Refactoring geolocation library