Refactored: activities controller