Minimal refactoring for widgets.