simplify isValid