further enhancements on generatesummary