Small refactor towards C# idioms and conventions.