JSDoc + refactoring