Refactor managing subscriptions ajax