A better way to do the un-nesting.