Cleaning up update routine