generalize output directory