improve code with resharper