Refactoring and JSHint