refactored episodes controller