refact according to jslint