refactoring del widget