Minor comment here. I think that getFilteredExtensionActivities is better only to return the filtered activities. The caller of this function should do something(callback) on the returned activities. getFilteredExtensionActivities performs two operations now. However, I am fine with the current one.