refactor SVD and Cholesky