Split visit function out into a separate visitor namespace.