Simplify pattern matching