refactor episode class