Update view when a message arrives
Remove unnecessary code
Use JSON for sending and receiving data