Quantum R Matrices And Factorization Problems