fix up the factory class, I'll use it after all as a submodule.