 
     switch action
       when 'delete'
-        index = robot.brain.get('louds').indexOf(data)
-        if index != -1
-          robot.brain.get('louds').splice(index, 1)
-          res.send "Loud deleted."
-        else
-          res.send "Couldn't find that loud."
+        deleteLoud(data)
 
       when 'ban'
-        if data in robot.brain.get('louds')
-          if data not in robot.brain.get('louds_banned')
-            robot.brain.get('louds_banned').push(data)
+        robot.brain.get('louds_banned').push(data) if not data in robot.brain.get('louds_banned')
+        deleteLoud(data)
 
       when 'nuke'
         if process.env.DEBUG != 'true'

        for loud in louds
          res.send loud

  # Initialize the louds list, if it doesn't exist yet.
  robot.brain.once 'loaded', (data) ->
    if not robot.brain.get('louds')?

  robot.hear /^([A-Z"][A-Z0-9 .,'"()\?!&%$#@+-]+)$/, (res) ->
    # Pick a loud from the stored list and say it. Skip if there are no louds.
    old_loud = res.random(robot.brain.get('louds'))

    if old_loud?
      res.send old_loud
