simplify nested clauses