pattern matching instead