Resharper code cleanup and refactors