sophia: checkpoint specific fixes and refactoring