functions accept and reuse connection objects