I'd leave in !D_DECL_IS_CONTRACT here.  Other than that, lgtm.