Loading on scroll logic improved; refactoring