On factorizations of maps between curves