Can this be simplified to only have on ``__get_messages`` function that optionally takes a msg_id?