more optimizations for getscroll logic