It'd be better to use a function declaration here. This way the function is hoisted and usable anytime. With `var` declaration, `formatArg` is undefined until line 503 is runned. It works now because the code is asynchronous, but this is error prone.