Clean up main loop and debug info