finish infinite scroll feature and add some code refactoring