Fixes and better PEP8 compliance and use DB for settings