Upgrader: Improved script and moved to just one file