Replace underscore with a general 'isType' function, which seems sufficient