Refactor visitor recognition in his own class, so that a third party plu...

...gin could reuse it.