Refactor widgets