ptree cleanup