Change way to import modules in the factory