Some refactoring. Add functionality for a more detailed summary.