Would you say the class approach would be better practice that nested functions?
i think whichever is simpler/more readable in your case should be your choice - closures can share state between functions just like classes share state between methods, but i find classes are more intuitive in cases where you want objects that you can pass around to call methods on them, but then again im no functional programming connoisseur