Ignore jshint warning 'Don't make functions within a loop', which is not really a problem in our code