improve JSDoc and start widget factory