some cleanup in main