refactor MediaService