isnt it better to write a the set root settings of a target away in a cache/array/tmp after being found. and check the cache if there is a set root setting for the target specified if so reuse the set root command that comes with the target