move disconnect things into a disconnect method in the client side code