refactored the ASTVisitor classes with a base class, but it hasn't helped fix replication of variables inside macros