useful type checking