I would advocate to remove the `hasType()` test as well.
IMO, failing silently in the case of an unknown type is a bad idea!