Added flags and some Ledger Entry refactoring