Remove dynamic_cast