base class and subclasses re-wrote