[Ide] Cleaned up the TreeViewState code a bit