I mean that you can create helper functions that factor out the part that repeats itself and then switch only on the part that changes, instead of repeating everything each time.