Use polymorphism in messages implementation