refactering for summary