Refactoring

Mostly C# standards compliance stuff