move *parent* handling to separate module