pruneSummary fn
testable version
As a module