Decoupled the UI window from the XMPPConnection for the shutdown hook with a closure method