Optimize anchor extraction