simplify connection handling