since `(x: Any).getClass` is always in `alternatives`, why not encode that in this method rather than at every call-site?