add id to parents array
simplify
refactor