Refactored EndlessScrollback with generic callback allowing reuse