Pattern matching for execution