Refactors code to allow for display of pending friends page