Added a base class, providing a get_type() method to avoid accessing the _type member from client classes.