[Refactory] Add save function.