Your example doesn’t look like nested functions.
It’s OK to have nested functions, and I use them sometimes. It should be noted that if the nested functions are too big (say 10 lines of code), you may want to move them out, because as you’re aware, nested functions can create some distraction that affects readability.