Factored out ID generating code to UniqueId generator object