Update code to JSHINT proof