modified factory.h comments