Some other queries reduced to a function getMessageInfo

Signed-off-by: emanuele <emanuele45@gmail.com>