Widget refactoring