Pagination HTML refactoring