refactoring + jshint