   action.id = item.id
   pageHandler.put thisPageElement, action
 
-initDragging = (pageElement) ->
-  storyElement = pageElement.find('.story')
+initDragging = ($pageElement) ->
+  storyElement = $pageElement.find('.story')
   storyElement.sortable(connectWith: '.page .story').on("sortupdate", handleDragging)
 
 
-initAddButton = (pageElement) ->
-  pageElement.find(".add-factory").live "click", (evt) ->
-    return if pageElement.hasClass 'ghost'
+initAddButton = ($pageElement) ->
+  $pageElement.find(".add-factory").live "click", (evt) ->
+    return if $pageElement.hasClass 'ghost'
     evt.preventDefault()
-    createFactory(pageElement)
-
-createFactory = (pageElement) ->
+    createFactory($pageElement)
+
+createFactory = ($pageElement) ->
   item =
     type: "factory"
     id: util.randomBytes(8)
   itemElement = $("<div />", class: "item factory").data('item',item).attr('data-id', item.id)
-  itemElement.data 'pageElement', pageElement
-  pageElement.find(".story").append(itemElement)
+  itemElement.data 'pageElement', $pageElement
+  $pageElement.find(".story").append(itemElement)
   plugin.do itemElement, item
   beforeElement = itemElement.prev('.item')
   before = wiki.getItem(beforeElement)
-  pageHandler.put pageElement, {item: item, id: item.id, type: "add", after: before?.id}
+  pageHandler.put $pageElement, {item: item, id: item.id, type: "add", after: before?.id}
 
 buildPageHeader = ({title,tooltip,header_href,favicon_src})->
   """<h1 title="#{tooltip}"><a href="#{header_href}"><img src="#{favicon_src}" height="32px" class="favicon"></a> #{title}</h1>"""
 
-emitHeader = (pageElement, page) ->
-  site = $(pageElement).data('site')
-  loading_a_remote_page = site? and site != 'local' and site != 'origin' and site != 'view'
+emitHeader = ($pageElement, page) ->
+  site = $pageElement.data('site')
+  isRemotePage = site? and site != 'local' and site != 'origin' and site != 'view'
   header = ''
 
-  pageHeader = if loading_a_remote_page
+  pageHeader = if isRemotePage
     buildPageHeader
       tooltip: site
       header_href: "//#{site}"

    if hits.length > 0
      page.story.push heading, hits...
      page.story[0].text = 'We could not find this page in the expected context.'
    wiki.buildPage( page, undefined, pageElement ).addClass('ghost')

  registerNeighbors = (data, site) ->
    if _.include ['local', 'origin', 'view', null, undefined], site

      neighborhood.registerNeighbor action.site if action.site?

  whenGotten = (data,siteFound) ->
    wiki.buildPage( data, siteFound, $pageElement )
    registerNeighbors( data, siteFound )

  pageHandler.get
