Updated code

Updated code with resharper