Extract create tuple id into a function