Code cleanup and Stylecop changes