tree filtering init
fix scanCallback recursive issue
tree filtering code cleanup
code cleanup
add comments to tree-filtering