AbstractWe study firms' corporate governance in environments where possibly heterogeneous shareholders compete for possibly heterogeneous managers. A firm, formed by a shareholder and a manager, can sign either an incentive contract or a contract including a Code of Best Practice. A Code allows for better managerial control but makes manager's decisions hard to react when market conditions change. It tends to be adopted in markets with low volatility and in low-competitive environments. The firms with the best projects tend to adopt the Code when managers are nottoo heterogeneous while the best managers tend to be hired through incentive contracts when the projects are similar. Although the matching between shareholders and managers is often positively assortative, the shareholders with the best projects might be willing to renounce to hire the best managers, signing contracts including Codes with lower-ability managers.