refactoring the summary view