Implemented createCodeTree() with dependencies