removing redundant multiprocessing code