Take Visitor as argument to rem and subst