Refactoring, largely to placate StyleCop.