Control connection code moved out