Refactor checkpoint