Refactored ubuntu_upgrade.py