Added internal code for multivariate factorization.