refactoring the current ip class