Context/connection refactor.