refactor: database.py