Refactor parameter_save.cpp