Try to avoid duplicate ids
remove nested items deeper than the first level