A main difficulty in understanding the dynamics of jets produced in the high-density environment of ultrarelativistic heavy ion collision,
is to provide a unified description for the two sources of radiation that are a priori expected: the "vacuum-like" emissions responsible for the parton shower from large virtualities down to the hadronisation scale and the "medium-induced" emissions responsible for the energy loss by the jet. In a recent paper arXiv:1801.09703, we demonstrated that these two mechanisms can be factorized from each other within a controlled, "double-logarithmic" approximation in perturbative QCD. In this proceeding we recall the main features of the jet evolution in a dense QCD medium. We emphasize that the in-medium parton showers differ from those in the vacuum in two crucial aspects: their phase-space is reduced and the first emission outside the medium can violate angular ordering. Based on this factorized picture, which is Markovian, we have recently developed a Monte Carlo event generator which includes both vacuum-like and medium-induced emissions and goes beyond the double logarithmic approximation. We here present our first results for the fragmentation function and the energy loss by the jet.