JSLint refactoring