Refactor datalist widget