- fix jshint and refactor