Cleanup of main