     @bar.setWidth diff
     @bar.setX "#{left}px"
 
+  _ಠcreateLabel : (value) =>
+    {maxValue, minValue, interval, showLabels} = @getOptions()
+
+    pos = ((value - minValue) * 100) / (maxValue - minValue)
+    @labels.push @addSubView label = new KDCustomHTMLView
+      cssClass    : "sliderbar-label"
+      partial     : "#{value}"
+    label.setX "#{pos}%"
+
   addLabels:->
     {maxValue, minValue, interval, showLabels} = @getOptions()
 
-    createLabel = (value)=>
-      pos = ((value-minValue)*100)/(maxValue-minValue)
-      @labels.push @addSubView label = new KDCustomHTMLView
-        cssClass    : "sliderbar-label"
-        partial     : "#{value}"
-      label.setX "#{pos}%"
+    if Array.isArray showLabels
+    then @_ಠcreateLabel value for value in showLabels
+    else @_ಠcreateLabel value for value in [minValue..maxValue] by interval
 
-    if Array.isArray showLabels
-      for value in showLabels
-        createLabel value
-    else
-      for value in [minValue..maxValue] by interval
-        createLabel value
-
-  getValues:->
-    values = []
-    for handle in @handles
-      values.push handle.getData().value
-    return values
+  getValues:-> handle.getOptions().value for handle in @handles
 
   setLimits:->
     {maxValue, minValue, interval}      = @getOptions()
 
     if @handles.length is 1
-      @handles.first.data.leftLimit     = minValue
-      @handles.first.data.rightLimit    = maxValue
+      @handles.first.options.leftLimit  = minValue
+      @handles.first.options.rightLimit = maxValue
     else
-      for handle in @handles
-        i               = @handles.indexOf(handle)
-        data            = handle.data
-
-        data.leftLimit  = @handles[i-1]?.getData().value + interval or minValue
-        data.rightLimit = @handles[i+1]?.getData().value - interval or maxValue
+      for handle, i in @handles
+        options            = handle.getOptions()
+        options.leftLimit  = @handles[i-1]?.options.value + interval or minValue
+        options.rightLimit = @handles[i+1]?.options.value - interval or maxValue
 
   attachEvents:->
-    @on "click", (event)->
+    @on "click", (event) ->
       {maxValue, minValue} = @getOptions()
       sliderWidth          = @getWidth()
       clickedPos           = event.pageX - @getBounds().x
-      clickedValue         = ((maxValue-minValue)*clickedPos)/sliderWidth + minValue
-      snappedValue         = @handles.first.getSnappedValue value : clickedValue
-      closestHandle        = undefined
-      mindiff              = undefined
+      clickedValue         = ((maxValue - minValue) * clickedPos) / sliderWidth + minValue
+      snappedValue         = @handles.first.getSnappedValue value: clickedValue
+      closestHandle        = null
+      mindiff              = null
 
       for handle in @handles
-        value   = handle.getData().value
-        diff    = Math.abs(clickedValue-value)
-        if (diff < mindiff) or (mindiff is undefined)
-          mindiff       = diff
-          closestHandle = handle
+        {value}            = handle.getOptions()
+        diff               = Math.abs(clickedValue - value)
+        if (diff < mindiff) or not mindiff
+          mindiff          = diff
+          closestHandle    = handle
 
       closestHandle.setValue snappedValue
 


  createHandles:->
    for value in @getOption "handles"
      @handles.push @addSubView handle = new KDSliderBarHandleView  {}, {value}

    sortRef = (a,b) ->
      return -1 if a.getData().value < b.getData().value
      return  1 if a.getData().value > b.getData().value
      return  0
    @handles.sort sortRef

  drawBar:->
    positions = []
    for handle in @handles
      positions.push handle.getRelativeX()

    len       =  positions.length
    left      = (parseInt(positions.first) if len>1) or 0
    right     =  parseInt(positions.last)
    diff      =  right - left

    unless @bar
      @addSubView @bar = new KDCustomHTMLView

    options.drawBar    ?= yes
    options.showLabels ?= yes
    options.snap       ?= yes
    options.snapOnDrag ?= no
    options.width     or= 300

    super options, data
