Improve on when to clear matches