simplify connect logic