applied some jslint rules