Moved WidgetFactory to widget.js