refactor friendship controller