connection_layer refactoring