jshint refactoring