Extract makeVariants helper function