move extraction of pet_scop from pet_tree to separate file