added a C# chain of responsibility pattern