Jshint refactoring