fixes #3999 - refactor DRY implementation of "nested label" for objects with ancestry