Clean up upgradeui (first class functions are cool)