cleaned up js to pass linting (almomst)