Reimplement using Server Sent Events and abstracting the communication layer in the client side