Infinite scroll and refactoring