implemented a bit of cleaning mechanism so there aren't as many activities in the history