Cleaning up the parallel learning code