Obviously it's pretty hard to produce easy to understand code with wrong abstractions. Objects or other data abstractions cannot help with control flow. Anonymous functions are for that.
Sorry if this sounds too basic but I'd love to learn more about how to apply anonymous functions to improve this kind of control flow - would you mind recommending some resources/examples?
Try "out of the tar pit" paper first
I've taken a quick look at it and looks very interesting, can't wait to fully read it this evening. Thank you!