lib: refactor folder term update after filename removal