lib: simplify the conn interface