remove redundent nesting