Generalize JSON references lookup