Refactoring C# code.