Refactoring for JSLint