Share more code path

Also simplify XMPP output