Refactoring IpLocator class