update pattern nesting