improving the cache mechanism and using it to store the interactions