C# common helper