QA: Simplify code in connect()