Refactored after jslint
Refactor jshint