spark_tree_view: some reshuffling + cleanups

cc: @umop