refactor Widget