more shared code and ip address format checking