 
       else if delta.retain?
         retain = parseInt delta.retain
-        from = @val position
-        to = @val (position + retain)
+        from = val position
+        to = val (position + retain)
 
         operation.call selections, from, to, delta.attributes
         return position + retain
 
-  insertHelper = (position, content) ->
+  insertHelper: (position, content) ->
     pusher = (position, char) =>
       if @_model?
         (@_get "characters").insert position, char


      if delta.insert?
        @insertHelper position, delta.insert
        from = @val position
        to = @val (position + delta.insert.length)
        operation.call selections, from, to, delta.attributes
        return position + delta.insert.length


  # @param position [Integer] start position for the delta, default: 0
  #
  # @return [Integer] the position of the cursor after parsing the delta
  deltaHelper: (delta, position = 0) ->
    val = (position) =>
      (@_get "characters").val(position)

    if delta?
      noneIsNull = (array)->
