Various changes around message display
Small redesign of code