Contract theory: Incentive contracts (when agents have multiple tasks) models by G. Baker and Holmstrom & Milgrom

So my question is the following:

In both Baker's (2002) and H & M (1991) models we have a problem that a principal is trying to design a stimulating contract in such way that the agent will choose such an effort that maximizes his utility or profit.

The contract usually looks like this: W = s + b * V(agent's_effort, some_stochastic_stuff). s - is, of course, some base payment. So the goal is to find the right "b".

In both models the first step is to find a "Best response function" of an agent - his choice for an effort vector in response to any value of "b". Great, no problems with that.

But then happens the magic (for me at least).

The next step in both models is to maximize the total surplus of agent and principal: EUagent + EProfit -> max for 'b' subject to {effort is a function of 'b'}.

So the thing that is a mystery for me here is why do we maximize total surplus? Isn't it me logically correct to maximize the principal's Expected profit since that him who is designing the contract....

Of course I understand that those models are classic, there cannot really be a mistake by authors, but I really cannot get the logic here...

If someone could shed some light over this, it would be quite great!