Refactoring widgets