Added simple pattern matching to build more complex scenarios.