widget: refactoring code
widget: refactoring code