refactor checkpointer.