Turn stringToId into its own function