Remove unused patterns