Clean up the main.py code.