Made Message class abstract and created a factory for it