Change copy_data to build_tree_per_node