Cleaning up the update code.