Rewrite a lot of codes.