Added generic singleton pattern.