Break out process reaping into its own function