JSDoc copyright and bit of refactoring