- Introduced `matched_templates` list to accumulate matching templates during execution.
- Adjusted the logic for removing commands from `noMatchedCmdPerRtr` to ensure removal only occurs when applicable.
- Added a processing step to iterate over `matched_templates`, ensuring all matched templates are correctly handled.