MLDS-325 MLDS-450 Refactor affiliate import code