Refactoring a la ReSharper; no errors or warnings now