implement dynamic rewrite code function