Added factory, base class and three subclasses