clean up and speed up summary generation