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 &amp; 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!

Thanks a lot in advance...
Holmström and Milgrom assume that the agent exhibits constant absolute risk aversion. This implies that if you change the total wage of the agent with a lump sum transfer (that does not depend on effort), you will not change the incentives. Hence, to find the optimal contract, you can find the contract that maximizes total surplus subject to incentive compatibility, and then subtract a lump sum amount to make the agent indifferent between accepting and not.