refactor js with lint