I think this breaks down when we have more than 2 levels. We should add a TODO since we may have other places in the code to change as well.