Move the summary outside of the complete 'when' block