refactoring logic in friend viewmodel in order to use new model from cloud service