Optional values with pattern matching