refactored service put mmm func in service