Refactoring widget