move uuid generation logic to a separate module