Optimizing the adiabatic buncher and phase-energy rotator for neutrino factories