improved smartpointer support