refactoring Widget