Refactor __.isType methods