This should be done by a pluggable (open) kind of lookup rather than a hard-coded detection based on if statement - perhaps it can be encoded as a grade option in the handler?