Code refactored with resharper
reformated code with resharper