Factor out vacillatory piece of code regarding parallel output