Improving code thanks to jshint