Add IPv6 support for expert mode and refactoring