If possible, don't (re)define a function each and every action (will waste RAM and add even more to GC).  Make this a global helper in the `api.actionProcessor` namespace.  You can probably share a helper with both pre and post-processing