Use unique_ptr with transitions.