Partly optimized code with Resharper