fix code style and JSDoc