minor refactoring of MPI distribution implementation.