Refactor of document uid concepts