refactored data parallelism to Parallel.ForEach