refactoring widgetAbstract