Refactor facebook friends logic.