 
   drawBar:->
     positions = []
-    for i in @handles
-      positions.push i.getPosition()
+    for handle in @handles
+      positions.push handle.getPosition()
 
     len    = positions.length
-    left   = (positions[0] if len>1) || 0
-    right  = positions[len-1]
+    left   = (positions.first if len>1) or 0
+    right  = positions.last
     diff   = right - left
 
-    if !@bar
+    unless @bar
       @addSubView @bar = new KDCustomHTMLView
         cssClass : "bar"
     @bar.setWidth diff, "%"
     @bar.setX "#{left}%"
 
   addLabels:->
-    maxValue = @getOption('maxValue')
-    minValue = @getOption('minValue')
-    interval = @getOption('interval')
+    {maxValue, minValue, interval} = @getOptions()
 
-    for v in [minValue..maxValue] by interval
-      pos = ((v-minValue)*100)/(maxValue-minValue)
+    for value in [minValue..maxValue] by interval
+      pos = ((value-minValue)*100)/(maxValue-minValue)
 
       @labels.push @addSubView label = new KDCustomHTMLView
         cssClass    : "sliderbar-label"
-        partial     : "#{v}"
+        partial     : "#{value}"
 
       label.setX "#{pos}%"
 

    super options, data

  attachEvents:->
    maxValue         = @parent.getOption('maxValue')
    minValue         = @parent.getOption('minValue')
    windowController = KD.getSingleton "windowController"

    @on "mousedown", ->
      @parent.bindEvent "mousemove"

    @labels             = []

  createHandles:->
    for name, {value} of @getData().handles
      @handles.push @addSubView handle = new KDSliderBarHandleView {name}, {value}

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