clean up code to make it pass jshint

so it is more readable