fix messages and add a couple of utils