refactor
Handle moves in the TreeFlattener