   # Sets the value for the binding. This Basically just runs the binding routine
   # with the suplied value formatted.
   set: (value) =>
-    value = if value instanceof Function and @options.special isnt 'event'
+    value = if value instanceof Function and !@binder.function
       @formattedValue value.call @model
     else
       @formattedValue value
 
-    if @options.special is 'event'
-      @currentListener = @routine @el, @model, value, @currentListener
-    else if @options.special is 'iteration'
-      @routine @el, value, @
-    else
-      @routine @el, value
+    @binder.routine?.call @, @el, value
 
   # Syncs up the view binding with the model.
   sync: =>


        Rivets.config.adapter.subscribe model, keypath, @sync


  # Unsubscribes from the model and the element.
  unbind: =>
    unless @options.bypass
      Rivets.config.adapter.unsubscribe @model, @keypath, @sync

      if @isBidirectional()
        unbindEvent @el 'change', @publish

    if @options.dependencies?.length
      for keypath in @options.dependencies

  # element, the type of binding, the model object and the keypath at which
  # to listen for changes.
  constructor: (@el, @type, @model, @keypath, @options = {}) ->
    unless @binder = Rivets.routines[type]
      for identifier, value of Rivets.routines
        if identifier isnt '*' and identifier.indexOf('*') isnt -1
          regexp = new RegExp "^#{identifier.replace('*', '.+')}$"
          if regexp.test type
            @binder = value
            @args = new RegExp("^#{identifier.replace('*', '(.+)')}$").exec type
            @args.shift()

    @binder or= Rivets.routines['*']

    if @binder instanceof Function
      @binder = {routine: @binder}

    @formatters = @options.formatters || []

  # Applies all the current formatters to the supplied value and returns the
  # formatted value.
