Refactoring towards `base.py`