the logic of generating UUID is also used in AGMemoryStorage. Refactor to common code would be nice