Change the visitor for a singleton class with templates.