   (with-storage [s storage-spec]
     (let [records-affected (first (update-transaction-item-index-and-balance
                                     s
-                                    item))]
+                                    (before-save-item item)))]
       (> records-affected 0))))
 
 (defn- calculate-item-index-and-balance

  [storage base-items]
  (->> base-items
       (group-by :account-id)
       (map (fn [[account-id items]
                 [account-id (first items)]]))
       (map (partial recalculate-account-items storage))
       (update-account-balances storage)))

(defn- create-transaction-and-adjust-balances
  [storage transaction]

        account (accounts/find-by-id storage (:account-id item)) ; TODO: remove redundant calls to find the account
        polarized-amount (accounts/polarize-amount item account)
        new-balance (+ balance polarized-amount)
        value-changed (update-item-index-and-balance storage (assoc item
                                                                    :index new-index
                                                                    :balance new-balance))
        result {:index new-index
                :balance new-balance
                :storage storage}]
