This paper is concerned with a refinement of the Stein factorization, and with applications to the study of deformations of surjective morphisms. We show that every surjective morphism f:X->Y between normal projective varieties factors canonically via a finite cover of Y that is etale in codimension one. This etale is characterized in terms of positivity of the push-forward of the structure sheaf and satisfies a functorial property. It turns out that the maximally etale factorization is stable under deformations, and naturally decomposes an etale cover of the Hom-scheme into a torus and into deformations that are relative with respect to the rationally connected quotient of the target Y. In particular, we show that all deformations of f respect the rationally connected quotient of Y.