Retain scoping in rebuild