Move starting a connection to new method
Move closing a connection to new method