Refactor activity service.