clean up the main file