cleaning up database.py