restructure internally