Replace is_subclass_of with reflection