Improve the memorization mode

Memory fills up quickly, causing issues like data loss because unnecessary information is memorized and other