added base class, factory and subclasses