       when 'SOURCE'
         [''] # TODO add details when client is available over FTP
       when 'PING'
-        [' ' + @args[0]]
+        [' ' + args[0]]
       else []
 
-  _parseMessage: (msg) ->
-    msg = msg[1..msg.length-2]
-    split = msg.split ' '
-    @type = split[0]
-    @args = split[1..]
+  ##
+  # @return {string} Returns a correctly formatted response to a CTCP request.
+  ##
+  _createCTCPResponse: (type, response) ->
+    "#{@_delimeter}#{type}#{response}#{@_delimeter}"
 
 exports.CTCPHandler = CTCPHandler
    return @getResponses(msg).length > 0

  getResponses: (msg) ->
    @_parseMessage msg
    responses = @_getResponseText()
    result = []
    for response in responses
      console.log response
      result.push "#{@_delimeter}#{@type}#{response}#{@_delimeter}"
    result

  _getResponseText: ->
    # TODO support the o ther types found here:
    # http://www.irchelp.org/irchelp/rfc/ctcpspec.html
    switch @type
      when 'VERSION'
        name = 'CIRC'
        environment = 'Chrome'

class CTCPHandler
  constructor: ->
    @_delimeter = '\u0001'

    # TODO: Respond with this message when an unknown query is seen.
    @_error ="#{@_delimeter}ERRMSG#{@_delimeter}"

  isCTCPRequest: (msg) ->
