Refactoring a la ReSharper; null reference checking, mostly