Technical efficiency and the vertical boundaries of the firm: theory and evidence