Refactored MD-service