Refactoring for ROI in affiliate marketing