Improving Auto-scroll implementation