remove boilerplate code in viewActivitiesController