Refactor populateEventList() into a common function