minor refactoring with jshint.