emulate virtual mechanism using typeinfo (typeid)