Added support for open generics and singleton instances