Fix invalid doc block
Deduplicate preparation of the activity rows after getting them from the db