refactor

use tree-visitor-async
test returning a promise