Refactoring if else - C#