updated factorymethod.h