Refactor media fragments to be mroe DRY