refactored the summary plugin