refactor scrolling