set_and_save helper