Minor refactorings suggested by resharper