Making constructed if-else statement more readable