Refactors message creation into separate file