re-applied and re-factored @nslater's message stuff