Simplify type check, add explanatory comment