Replace a multimethod by a protocol for performance reasons.