refactor widgets