Small refactoring of JavaScript.p4d