Smarter take/limit implementation.