Refactor.
Refactor.
Refactor.
Fix ipv6 parsing.