Make the longpolling system independent of the other modules. Change the actual code for the new longpolling way. Use the longpolling into the notification system.