       q["type"][s.get("substory_type")] = true
       return q
     
-    unless this.expanded
+    unless @expanded
       json["substories"] = json["substories"].slice(0, 2)
     
-    json["expanded"] = this.expanded
+    json["expanded"] = @expanded
     
-    this.$el.html this.template(json)
+    @$el.html @template(json)
     
     that = this
-    this.$el.find("a.show-more").click ->
+    @$el.find("a.show-more").click ->
       that.toggleExpand()
       
   toggleExpand: ->
-    this.expanded = !this.expanded
-    this.render()
+    @expanded = !@expanded
+    @render()
     
 StoryCollectionViewClass = Backbone.View.extend
   initialize: ->
     _(this).bindAll 'add', 'remove'
-    this.views = {}
-    this.collection.bind 'add', this.add
-    this.collection.bind 'remove', this.remove
-    this.loadedAll = false
-    this.fetchInProgress = false
+    @views = {}
+    @collection.bind 'add', @add
+    @collection.bind 'remove', @remove
+    @loadedAll = false
+    @fetchInProgress = false
   add: (story) ->
-    this.views[story.cid] = new StoryView
+    @views[story.cid] = new StoryView
       model: story
   remove: (story) ->
-    delete this.views[story.cid]
+    delete @views[story.cid]
   render: ->
-    this.$el.empty()
+    @$el.empty()
     that = this
-    this.collection.each (model) ->
+    @collection.each (model) ->
       view = that.views[model.cid]
       view.render()
       that.$el.append view.$el
-    $(".activity-feed").append this.$el
+    $(".activity-feed").append @$el
   fetchMore: (baseURL) ->
-    unless this.loadedAll or this.fetchInProgress
-      page = 1 + Math.floor(this.collection.length / 20)
-      this.fetchInProgress = true
+    unless @loadedAll or @fetchInProgress
+      page = 1 + Math.floor(@collection.length / 20)
+      @fetchInProgress = true
       that = this
       $.ajax baseURL + "page=" + page,
         dataType: "json"

  return -moment(story.get("updated_at")).unix()

StoryView = Backbone.View.extend
  initialize: -> this.expanded = false
  template: HandlebarsTemplates["stories/story"]
  
  render: ->
    json = this.model.toJSON()
    json["type"] = {}
    json["type"][this.model.get("story_type")] = true
    
    json["morethantwo"] = json["substories"].length > 2
    json["additional"] = json["substories"].length - 2

SubstoryModel = Backbone.Model.extend
  decoratedJSON: ->
    json = @toJSON()
    json["type"] = {}
    json["type"][@get("substory_type")] = true
    return json

StoryModel = Backbone.Model.extend
  initialize: ->
    substories = @get("substories")

    substoriesCollection = new SubstoryCollectionClass
    @set "substories", substoriesCollection

    that = this
    _.each substories, (x) -> x.user = that.get("user")
