cleanups in main