Refactor Part III: cleaning rest parts except mem_fp.