jshint - revised code to comply