updated Factory Method example