finished the factory pattern