Introducing case statement to replace it-then-fi