Refactored code to use friendsservice