move old scroll handler code into separate file