restructure table