Small optimizations to update routine