prepare to collect constraints and check hierarchy