Stylecop cleanup and refactoring