We selected a sample of 33 Gamma Ray Bursts (GRBs) detected by Swift, with known redshift and optical extinction at the host frame. For these, we constructed the de-absorbed and K-corrected X-ray and optical rest frame light curves. These are modelled as the sum of two components: emission from the forward shock due to the interaction of a fireball with the circum-burst medium and an additional component, treated in a completely phenomenological way. The latter can be identified, among other possibilities, as late prompt emission produced by a long lived central engine with mechanisms similar to those responsible for the production of the standard early prompt radiation. Apart from flares or re-brightenings, that we do not model, we find a good agreement with the data, despite of their complexity and diversity. Although based in part on a phenomenological model with a relatively large number of free parameters, we believe that our findings are a first step towards the construction of a more physical scenario. Our approach allows us to interpret the behaviour of the optical and X-ray afterglows in a coherent way, by a relatively simple scenario. Within this context it is possible to explain why sometimes no jet break is observed; why, even if a jet break is observed, it is often chromatic; why the steepening after the jet break time is often shallower than predicted. Finally, the decay slope of the late prompt emission after the shallow phase is found to be remarkably similar to the time profile expected by the accretion rate of fall-back material (i.e. proportional to t^{-5/3}), suggesting that this can be the reason why the central engine can be active for a long time.