Some helpers in C#