media code cleanup