  The energy released by the inner engine of GRBs can originate from structural
readjustments inside a compact star. In particular, the formation of deconfined
quark matter can liberate enough energy to power the burst. We show that the
burning of a neutron star into a quark star likely proceeds as a deflagration
and not as a detonation. In that way no strong baryon contamination is produced
near the surface of the star. It is tempting to associate the temporal
structures observed in the light curves with specific processes taking place
inside the compact star. The so-called quiescent times, during which no signal
is emitted in the highest energy band, correspond to pauses during the
processes of readjustment. If the quark (or hybrid) star formed after these
transformations is strongly magnetized and rotates rapidly, a prolonged gamma
emission can be produced, as proposed by Usov years ago. This can explain the
quasi-plateau observed by Swift in several GRBs.
