adding factory for messages