restructure state