Templatized pool and singleton pattern.