Refactoring kata for training removal of "instanceof"