Refactor ModuleInstaller.Upgrade