Refactors friendships.