dependency tree optimization