Factorization of systems of differential equations