Refactor using the general update pattern