You can change this expression to directly return LedgerExportData.

Thus, a separate transaction will be created for every closure, and it will also simplify the code below. You can simply write `ledger ++ closureEntries` as the result of this function.