replace dynamic_cast to std::is_base_of