Added a widget and refactored..