The uninstall script refactored