CLeaning up code according to jsl and jslint