Optimize scan