jshint errors and trimming methods