refactored findCodeVariants to extract method produceSingleVariant