simplify ip validator functions