Some more refactoring to take advantage of unused C# features