added Typeable class to replace Java instanceOf