Reformat Affiliate UI code