Refactored out common code from Distillers