factored out ast walking to astw