Improve connect/quit