fix jshint 'Too many var statements.' error