UUID.to_hex()-related refactoring.