Added the factory pattern base example