infinite scroll refactor