refactor ip