move function from anonymous to enable v8 optimisation
Merge branch 'danjenkins-v8_optimisation'