refactor handling of child targets