refactor MPI