Began refactoring whit.py