refactor datagrid implement