add initial tests
refactor IPv4 check