Connect/reconnect refactoring