A general theory of maintenance