"Converting" between base class and derived class types