Kind of confusing code (at least shown like this), functions returning functions. What's the origin of the snippets?This will require some digging on the source.