Generate ID if one is not passed explicitly