Simplify Media handling code