starting some optimisations for invoice_all