Delegation, externalities and organizational design