Remove the update hook and improve the script.

#3197