refactor media modal