Are you referring to the function treat() here?
treat is a function of 10 lines that does a lookup in a vector and calls the treat function if found.
More straightforward is almost impossible.