FIX: take parent visibility into account when adding representation
FIX: take parent visibility into account when adding representation

also remove code duplication

arose/ngl,fredludlow/ngl,arose/ngl,fredludlow/ngl,fredludlow/ngl,j0kaso/ngl,j0kaso/ngl,arose/ngl,arose/ngl,fredludlow/ngl,j0kaso/ngl