refactor(pagination): refactor and clean unused code