Refactor friending flow. Add helper functions to clean things up.