more refactoring
refactored invoices controller