refactor invoices page1 and page2