Cleanup. Move some code to a more appropriate location, and show the old connection a quit message instead of just breaking the connection.