Delegates in C#: Creating flexible code