Simplified connection code.