This if else logic is getting too hard to read. Could you please refactor so that it uses another case statement.