refactored invoicing_spec