Cleaned db.py