remove unused patterns