refactoring widgets