cleaning up nesting