Can you use `instanceof` here instead of calling `getType()` and then `switch`ing on the returned string?