refactoring editing friends part