srv now handle playMsg
Refactor msgCasting and improve code formatting