Refactor: introduce isType reducing redundancy (trivial change)