Fix style issues
extract collector to the class that collects results
    
remove the collector from the base visitor class, instead use it in the subclass that collects results