Refactoring to jshint standards