refactor and cleanup checkpoint