Added implicit conversion for case class Message and removed unneeded casts