Replacing direct item references with UID