refactor localization, ip retrieval and services