Refactoring xmpp file
More refactoring of xmpp module