validate_user: split and simplify method.