Refactoring RecentActivityService to eliminate repetition.