     $('item', node).map(-> new Contact this ).get()
 
   findRoster: (callback) ->
-    node = $("""
+    node = this.xml """
       <iq id='#{this.uniqueId()}' type="get">
         <query xmlns="jabber:iq:roster"/>
       </iq>
-    """)
-    this.sendIQ node.get(0), (result) =>
+    """
+    this.sendIQ node, (result) =>
       contacts = this.parseRoster(result)
       @roster[contact.jid] = contact for contact in contacts
       callback()

    @xmpp.send node

  sendPresence: (away, status) ->
    node = $ '<presence/>'
    if away
      node.append $('<show>xa</show>')
      node.append $('<status/>').text status if status != 'Away'
    else
      node.append $('<status/>').text status if status != 'Available'
    @xmpp.send node.get 0

  sendIQ: (node, callback) ->
    @xmpp.sendIQ node, callback, callback, 5000

  updateContact: (contact, add) ->
    node = $("""
      <iq id="#{this.uniqueId()}" type="set">
        <query xmlns="jabber:iq:roster">
          <item name="" jid="#{contact.jid}"/>
        </query>
      </iq>
    """)
    $('item', node).attr 'name', contact.name
    for group in contact.groups
      $('item', node).append $('<group></group>').text group
    @xmpp.send node.get 0
    this.sendSubscribe(contact.jid) if add

  removeContact: (jid) ->
    node = $("""
      <iq id="#{this.uniqueId()}" type="set">
        <query xmlns="jabber:iq:roster">
          <item jid="#{jid}" subscription="remove"/>
        </query>
      </iq>
    """)
    @xmpp.send node.get 0

  sendSubscribe: (jid) ->
    @xmpp.send this.presence jid, 'subscribe'

          callback true
          this.findRoster =>
            this.notify('roster')
            @xmpp.send this.xml '<presence/>'
            this.findCards()

  disconnect: -> @xmpp.disconnect()
