a smal refactoring to generate more complete environment+dependencies tree