initiated code reorganisation for serial communication