Refactoring for JSLint and to clean things up.