Refactored some AI multiprocessing.