dynamic widgets refactor