Simplify a pattern match