Some refactoring of widgets