checkpointing refactor to schedule