AbstractFactoryDesignPattern: ported code from tutorial