         validated
         (let [existing (find-by-id storage (:id validated) (:transaction-date validated))
 
-              ; dereferenced items
+              ; dereferenced items - items removed from the transaction
               dereferenced-items (remove (fn [{existing-item-id :id}]
                                            (some #(= existing-item-id
                                                      (:id %))

              _ (doseq [item dereferenced-items]
                  (delete-transaction-item storage (:id item) (:transaction-date item)))

              ; current items
              _ (doseq [item (:items transaction)]
                  (upsert-item storage (before-save-item item)))


              ; process all item updates
              _ (recalculate-items storage (concat current-base-items
                                                   dereferenced-base-items
                                                   dereferenced-account-id-base-items))

              ; update the transaction record itself
              updated (update-transaction storage validated)
