Kinetic behaviour of chemical reactions in homogeneous and heterogeneous polymer melts