Create base class, sub classes, and factory