Automated filtering of prefixes