Cleanup to use AtomicUpdate.