Improve ast_traverse