Refactor 3 if statements into if.. else statement.