major refactor, adds trackPurchaseOrder