add sample code of FactoryMethod