get_all_invoices: more pretty code