If you need help refactoring the code, you need to provide real code, with real cases, not all, but minimal to see the schematic, to be able to help, or maybe use codereview.stackexchange.com. So here, is the series c1, c2, c3, c4, c5 ... c9342 in increments of +1 ? Also what are do1, do2, do3... ? Methods ? Duplicate inner code with extractable parameters ? Or totally different processings ? Otherwise, in addition to if and switch, and the use of parameters to factorize in some methods and loops, you can also use dispatch tables like exposed by the answer of @AndreSantarosa. —
Olivier Rogier 46 secs ago