upgrades and cleanup