refactor tasks index pagination