refactor the `isa' method