cleanup with nesting