add example to the factory pattern