RF-13004: resource optimizer: recursively scan for resources