tidy up dependency tree