refactor for goxmpp