Using pattern matching