Refactor index pagination view