more machinery for the connection code