Minor syntax change
Refactored code to reuse logic for computing number of pages on search results