remove unneeded codes
Rewrite before and after fork