     opt.data 'image',    $('#template_image option:selected').val()
     opt.data 'shortcut', $('#template_shortcut').val().trim().toUpperCase()
     opt.text $('#template_title').val().trim()
-    opt.val  $('#template_name').val().trim()
   opt
 
 # Update the selection of templates in the toolbar behaviour section to reflect
 # those available in the templates section.
 updateToolbarTemplates = ->
-  templates                = []
-  toolbarTemplates         = $ '#toolbarTemplateName'
-  toolbarTemplateName      = store.get 'toolbarTemplateName'
-  lastSelectedTemplate     = toolbarTemplates.find 'option:selected'
-  lastSelectedTemplateName = ''
+  templates               = []
+  toolbarKey              = store.get 'toolbar.key'
+  toolbarTemplates        = $ '#toolbarKey'
+  lastSelectedTemplate    = toolbarTemplates.find 'option:selected'
+  lastSelectedTemplateKey = ''
   if lastSelectedTemplate.length
-    lastSelectedTemplateName = lastSelectedTemplate.val()
+    lastSelectedTemplateKey = lastSelectedTemplate.val()
   toolbarTemplates.find('option').remove()
   $('#templates option').each ->
     $this    = $ this
     template =
-      name:     $this.val()
+      key:      $this.val()
       selected: no
       title:    $this.text()
-    if lastSelectedTemplateName
-      template.selected = yes if template.name is lastSelectedTemplateName
-    else if template.name is toolbarTemplateName
+    if lastSelectedTemplateKey
+      template.selected = yes if template.key is lastSelectedTemplateKey
+    else if template.key is toolbarKey
       template.selected = yes
     templates.push template
   for template in templates
     option = $ '<option/>',
-      text:  "#{template.title} (#{template.name})"
-      value: template.name
+      text:  template.title
+      value: template.key
     option.attr 'selected', 'selected' if template.selected
     toolbarTemplates.append option
 
 # Validation functions
 # --------------------
 
-# Indicate whether or not the specified `name` is available for use by a
-# template.
-isNameAvailable = (name, additionalNames = []) ->
+# Indicate whether or not the specified `key` is new to this instance of
+# Template.
+isKeyNew = (key, additionalKeys = []) ->
   available = yes
   $('#templates option').each ->
-    available = no if $(this).val() is name
-  available and name not in additionalNames
-
-# Indicate whether or not the specified `name` is valid for use by a template.
-isNameValid = (name) ->
-  name.search(R_VALID_NAME) isnt -1
+    available = no if $(this).val() is key
+  available and key not in additionalKeys
+
+# Indicate whether or not the specified `key` is valid.
+isKeyValid = (key) ->
+  R_VALID_KEY.test key
 
 # Indicate whether or not the specified keyboard `shortcut` is valid for use by
 # a template.
 isShortcutValid = (shortcut) ->
-  shortcut.search(R_VALID_SHORTCUT) isnt -1
+  R_VALID_SHORTCUT.test shortcut
 
 # Indicate whether or not `template` contains the required fields of the
 # correct types.

      $('#template_enabled').attr 'checked', 'checked'
      $('#template_image option').first().attr 'selected', 'selected'
      $('#template_image').change()
      $('#template_name').val ''
      $('#template_shortcut').val ''
      $('#template_title').val ''
    else


# Create a template from the information from the imported `template` provided.  
# `template` is not altered in any way and the new template is only created if
# `template` has a valid key.  
# Other than the key, any invalid fields will not be copied to the new template
# which will instead use the preferred default value for those fields.
addImportedTemplate = (template) ->
  if isKeyValid template.key
    newTemplate =
      content:  template.content
      enabled:  template.enabled
      image:    ''
      key:      template.key
      readOnly: no
      shortcut: ''
      title:    i18n.get 'untitled'
