Refactor Checkpoints, add test