Group patterns together so they can use a common handler.
A bit of reformatting for readability.