Optimize ModuleManager.