rewrite strucutre code