Clean up redundant db config code
PEP8 fixes