   [storage transaction]
   (update-in transaction
              [:items]
-             #(map (fn [item]
-                     (let [previous-item (get-previous-item storage item (:transaction-date transaction))
-                           previous-balance (or (get previous-item :balance)
-                                                (bigdec 0))
-                           next-index (+ 1 (or (get previous-item :index) -1))
-                           polarized-amount (accounts/polarize-amount storage item)]
-                       (-> item
-                           (assoc :balance (+ previous-balance
-                                              polarized-amount)
-                                  :index next-index)))) %)))
+             #(map (partial add-item-balance-and-index
+                            storage
+                            (:transaction-date transaction))
+                   %)))
 
 (defn- subsequent-items
   "Returns items in the same account with an equal or greater

    (find-transaction-item-preceding-date storage
                                          (:account-id item)
                                          transaction-date)))

(defn- update-balances
  "Updates transaction item and account balances resulting from the
  specified transaction.
  

    (if (validation/has-error? validated)
      validated
      (let [storage (storage storage-spec)
            with-balances (calculate-balances-and-indexes storage validated)
            _ (update-affected-balances storage-spec (:items with-balances))
            result (create-transaction storage (before-save with-balances))
            items (into [] (map #(->> (assoc % :transaction-id (:id result))
