   action.id = item.id
   pageHandler.put thisPageElement, action
 
-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'
+initDragging = ($page) ->
+  $story = $page.find('.story')
+  $story.sortable(connectWith: '.page .story').on("sortupdate", handleDragging)
+
+
+initAddButton = ($page) ->
+  $page.find(".add-factory").live "click", (evt) ->
+    return if $page.hasClass 'ghost'
     evt.preventDefault()
-    createFactory($pageElement)
-
-createFactory = ($pageElement) ->
+    createFactory($page)
+
+createFactory = ($page) ->
   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', $page
+  $page.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 $page, {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')
+emitHeader = ($page, page) ->
+  site = $page.data('site')
   isRemotePage = site? and site != 'local' and site != 'origin' and site != 'view'
   header = ''
 

      neighborhood.registerNeighbor action.site if action.site?

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

  pageHandler.get

  sourceSite = sourcePageElement.data('site')

  destinationPageElement = itemElement.parents('.page:first')
  equals = (a, b) -> a and b and a.get(0) == b.get(0)

  moveWithinPage = not sourcePageElement or equals(sourcePageElement, destinationPageElement)
