Added Factory and Singleton patterns