Message sending code is now more modular