XMPP Debugging/Refactoring