     checkboxField =
       key: 'checked'
       label: ''
-      fn: (value, object) ->
-        getValue = checkbox.getValue
-        if getValue
-          value = getValue(object)
-        checked = if value then 'checked' else ''
-        html = '<input type="checkbox" ' + checked + ' />'
-        Spacebars.SafeString(html)
+      fn: (value, object) -> createCheckbox(value, object, checkbox)
     if Types.isObject(checkbox.field)
       _.extend checkboxField, checkbox.field
     fields.unshift checkboxField

  getDomNode: getDomNode
  setDomTableId: setDomTableId
  getDomTableId: getDomTableId

# Template methods.


setDomTableId = (domNode, id) -> $(domNode).data(domNodeField, id)

getDomTableId = (domNode) -> $(domNode).data domNodeField

createCheckbox = (value, object, checkbox) ->
  getValue = checkbox?.getValue
  if getValue
    value = getValue(object)
  checked = if value then 'checked' else ''
  html = '<input type="checkbox" ' + checked + ' />'
  Spacebars.SafeString(html)

configureSettings = (template) ->
  data = template.data
