Cleaned up MaterialPackageManager.write_output_module().