refactored mp