remove irrelevant transactions from history