tree filter improvement

optimize logging, comments.