Couple data with tree, finish refactoring.