Refactoring of mdps