refactoring for Adaptive_Forgetting.ipynb