The discovery of a short gamma‐ray burst (GRB), GRB170817A, in association with a gravitational wave (GW) and a bright kilonova started a new era in the high‐energy astrophysics. The observation of GRB170817A and more recently, GRB200826A and GRB211211A, a short and a long burst, respectively, with a possible kilonova, reinforce the concern about new ways of classification. For this reason, a new machine learning technique is applied to Swift‐BAT data, searching for morphological similarities in the light curves. The resulting map is characterized by two distinct groups, although still correlated with standard T90 duration. Since a jet viewed off‐axis could explain the emission from GRB170817A, the modeling of this kind of sources is of great importance. A public code called JetFit, based on the “boosted fireball” model, is applied to fit Swift‐XRT afterglow light curves of short and long GRBs, with known red‐shift, from 2005 to 2021. JetFit does not model the flaring activity. For this purpose, a new technique to remove the time flaring phases, is developed. This analysis provides a comprehensive study of the prompt and of the afterglow phase, trough the study of the best‐fit parameters.