checkpoint refactor db