Wrap the scrolling into a method.