added linter and refactored js