restructed code.