Refactor Dynamic Document clone