Refactored createMessage method to remove entity validation.