attempt to optimize forEachObjectRecursive