Some refactoring. Didn't realize update can take more than one line.