Snippet of instantiate for generic objectg