Modified macros in factory.hpp