Refactoring location service