refactored widget