Templated the factory classes into a single dynamic class
factory.