Refactor for better JSDoc