refactor NameAST visitor