Made id generation more generic