move the Upgrade stuff into private-upgrade.cc