SetConnOpt refactor