extract KindVisitor and VarVisitor