#6595: Refactor Upgrade Task