Added jshint options and refactored code.