Optimal management of natural resources. Accounting for heterogeneity