Cleaned up infinite scroll code