Switched to `switch` statement rather than if elses for simple checks