Design patterns in C#