Snippet refactoring for FileService and ActivityService JS