ReSharpering

Some refactoring suggested by ReSharper