restructed code