Added singleton pattern, and tests passed