CC-5 factored out database connection