cleaned the code in order reduce the jshint errors to a minimum (currently only "8 problems")