connection refactor.