         if buildTypeMatches?
           configuration = buildTypeMatches[1]
           project = buildTypeMatches[2]
-   
+        else
+          buildTypeRE = /^\s*of (.*)/i
+          buildTypeMatches = option.match buildTypeRE
+          if buildTypeMatches
+            configuration = buildTypeMatches[1]
+            project = null
+
         getBuilds msg, project, configuration, (err, msg, builds) ->
           if not builds
             msg.send "Could not find builds for #{option}"
             return
-
-          for build in builds
-            mapBuildTypeIdToName msg, build['buildTypeId'], (err, msg, name)->
-              baseMessage = "##{build.number} of #{name} #{build.webUrl}"
-              if build.running
-                status = if build.status == "SUCCESS" then "**Winning**" else "__FAILING__"
-                message = "#{status} #{build.percentageComplete}% Complete :: #{baseMessage}"
-              else
-                status = if build.status == "SUCCESS" then "OK!" else "__FAILED__"
-                message = "#{status} :: #{baseMessage}"
-
-              msg.send message
+          createAndPublishBuildMap(builds, msg)

    msg.http(url)
      .headers(getAuthHeader())
      .get() (err, res, body) ->
         err = body unless res.statusCode == 200
         projects = JSON.parse(body).project unless err
         callback err, msg, projects

  getBuildTypes = (msg, project, callback) ->
    projectSegment = ''
    if project?
      projectSegment = '/projects/name:' + encodeURIComponent project
    url = "#{base_url}/httpAuth/app/rest#{projectSegment}/buildTypes"
    console.log url
    msg.http(url)
      .headers(getAuthHeader())
      .get() (err, res, body) ->
         err = body unless res.statusCode == 200
         buildTypes = JSON.parse(body).buildType unless err
         callback err, msg, buildTypes

  getBuilds = (msg, project, configuration, callback) ->
    projectSegment = ''

#
# Dependencies:
#   "underscore": "1.3.3"
#   "async": "0.2.7"
#
# Configuration:
#   HUBOT_TEAMCITY_USERNAME = <user name>
