Start of the rm command, refactor the tree and item