       else
         @_exerciseCache[exerciseId]?.is_excluded
 
-    getChapterSectionOfExercise: (exercise) ->
-      getChapterSection(exercise)
-
-    getGroupedIncludedExercises: (pageIds) ->
-      exercises = @_exercises[pageIds.toString()]
-      includedExercises = _.reject exercises, 'is_excluded'
-      _.groupBy(includedExercises, getChapterSection)
-
-    groupBySectionsAndTypes: (pageIds, options = {withExcluded: false}) ->
+    getChapterSectionOfExercise: (ecosystemId, exercise) ->
+      getChapterSection(ecosystemId, exercise)
+
+    groupBySectionsAndTypes: (ecosystemId, pageIds, options = {withExcluded: false}) ->
       all = @_exercises[pageIds.toString()] or []
       unless options.withExcluded is true
         all = _.filter( all, (ex) -> ex.is_excluded isnt true )
       results = {
         all:
           count: all.length
-          grouped: groupBySortedSections(all)
+          grouped: groupBySortedSections(ecosystemId, all)
       }
       for name, pool_type of EXERCISE_TYPE_MAPPING
         exercises = filterForPoolType(all, pool_type)
         results[name] = {
           count: exercises.length
-          grouped: groupBySortedSections(exercises)
+          grouped: groupBySortedSections(ecosystemId, exercises)
         }
       results
 

    getPageExerciseTypes: (pageId) ->
      _.unique _.flatten _.map @_exercises[pageId], @exports.getExerciseTypes

    # poolTypes: (exercise) ->
    #   _.without( exercise.pool_types, 'all_exercises')

    allForPage: (pageId) ->
      @_exercises[pageId] or []


filterForPoolType = (exercises, pool_type) ->
  _.filter exercises, (exercise) -> -1 isnt exercise.pool_types.indexOf(pool_type)


groupBySortedSections = ( ecosystemId, exercises ) ->
  sections = {}
  grouped = _.groupBy(exercises, (exercise) ->
    getChapterSection(ecosystemId, exercise)
  )
  for section in _.sortBy( _.keys(grouped), ContentHelpers.chapterSectionToNumber)
    sections[section] = grouped[section]
  sections
