Refactored to list media and made tests pass