rewrite & restructure