refactoring for JSLint Validation