Factored out and improved filtering.
Added traversal target interface to flush set.