Added factory and Singleton Patterns