Refactoring and checkpoint