Refactor MediaManager