less inefficient db load and better message creation function