Refactor: move Base to entities.py.