Split do_update method in serveral functions.