media refactoring