Pulled out the scatter/gather into their own routines.