refactoring db config stuff