Abstract batch overlapping during search and optimize a bit.