Simplified C# code