Generic Implementation of the Singleton Pattern