Merging placeInTree and create file functionality