Extracted the connection class
fixed merge