simplify type check