Use case statement rather than if.