Use pattern matching.