Refactoring media service