Since `idx` is only used as a key now, I'd probably just leave it out of this function entirely, and just set a static key lower down in the code.