   # datastore = new DataStore.ChromeStorageLazy
 
   datastore = new DataStore.InMemory
-  document = new Document datastore
+  doc = new Document datastore
   chrome.storage.sync.get 'save', (results) ->
-    create_session document, (results.save or constants.default_data)
+    create_session doc, (results.save or constants.default_data)
 
     # save every 5 seconds
     setInterval (() ->
       chrome.storage.sync.set {
-        'save': document.serialize()
+        'save': doc.serialize()
       }, () ->
         # TODO have whether saved visualized
         Logger.logger.info 'Saved'

  ####################

  if to_load != null
    document.load to_load
    # a bit hack.  without this, you can undo initial marks, for example
    do session.reset_history
    do session.reset_jump_history

  # render when ready
  $(document).ready ->
    View.renderSession session

  key_handler = new KeyHandler session, key_bindings

