Refactor the updater bash script