widget class refactoring