refactoring ledger creation from transaction creation