Separated db config out of db functions