 
     @allowButton = new KDButtonView
       title    : "Allow"
-      callback : => @createBehavior 'allow'
+      callback : => @createRule 'allow'
 
     @denyButton = new KDButtonView
       title    : "Deny"
-      callback : => @createBehavior 'deny'
+      callback : => @createRule 'deny'
 
     @deleteButton = new KDButtonView
-      title : "Delete"
-      viewOptions:
-        cssClass : 'delete-button'
+      title       : "Delete"
+      viewOptions :
+        cssClass  : 'delete-button'
+      callback    : => @deleteFilter()
 
   viewAppended:->
     @unsetClass 'kdview'
     @setTemplate @pistachio()
     @template.update()
 
-  createBehavior:(behavior)->
+  createRule:(behavior)->
     data = @getData()
     delegate = @getDelegate()
 
     KD.remote.api.JDomain.one {domainName:data.domainName}, (err, domain)->
       return console.log err if err
-      domain.createRuleBehavior
-        ruleName   : data.ruleName
-        behaviorInfo :
-          enabled : "yes"
-          action  : behavior
-          index   : "0"
-      , (err, response)=>
-        if not err
-          delegate.emit "newRuleCreated", {domainName:data.domainName, ruleName:data.ruleName, action:behavior}
+      params = 
+        domain    : domain.getId()
+        action    : behavior
+        match     : data.match
+      domain.createProxyRule params, (err, rule)->
+        return console.log err if err
+        delegate.emit "newRuleCreated", {domainName:data.domainName, ruleName:data.ruleName, action:behavior}
+
+  deleteFilter:->
+    data = @getData()
+    KD.remote.api.JProxyFilter.remove {_id:data.getId()}, (err)=>
+      unless err then @destroy()
 
   pistachio:->
     """

      type  : filterType
      match : filterMatch
    , (err, filter)->
      unless err 
        delegate.emit "newFilterCreated", {filterName, filterMatch}

      return new KDNotificationView 
        title : "An error occured while performing your action. Please try again."

    # both allow & deny buttons live on FirewallfilterListItemView.
    @ruleListController.getListView().on "newRuleCreated", (item) => 
      @ruleListController.addItem item

  updateActionOrders:(domain)->
    for item, index in @ruleListController.itemsOrdered
