Refactor `update` to reduce wasted lookups

By moving most of the `update` logic into `add`, we can eliminate all of the duplicated work in the existence check loop.