factor out connection settings