Adding Singleton and Pub-Sub JS pattern