Refactor some logging code
Split disconnecting from op:leave to op:disconnect