Refactored - introduced Singleton pattern and observer pattern