General code improvement and added uuid and docid to all records.