Refactors #get_page_event_ids method to improve legibility.