For a large class of replacement models for stochastically deteriorating systems the optimality criteria of total expected discounted cost and long-run (expected) average cost per unit time have a common structure. In the present paper a formal description of this structure is given and the optimal rule is determined. A so-called ‘λ -minimization technique' is applied. This method is discussed in general terms.